Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

장고 Google Cloud Storage #16

Open
Zih0 opened this issue Aug 7, 2021 · 1 comment · Fixed by #17
Open

장고 Google Cloud Storage #16

Zih0 opened this issue Aug 7, 2021 · 1 comment · Fixed by #17
Labels
documentation📂 Improvements or additions to documentation

Comments

@Zih0
Copy link
Contributor

Zih0 commented Aug 7, 2021

이미지파일 GCS로 서비스하기

@Zih0
Copy link
Contributor Author

Zih0 commented Aug 7, 2021

from server.utils.upload import upload_image

def upload_test(request):
    ...
    image = request.FILES["image"]
    #위에서 request로부터 받은 image file을 upload_image(파일, 넣을 폴더명)으로 넣으면 이미지 uri 주소를 반환해준다.
    #해당 uri를 활용해서 save하면 db에 저장, 혹은  Response해줄 수 있다. 
    public_uri = upload_image(image, "review")
    

@Zih0 Zih0 added the documentation📂 Improvements or additions to documentation label Aug 7, 2021
Zih0 added a commit that referenced this issue Aug 7, 2021
@Zih0 Zih0 linked a pull request Aug 7, 2021 that will close this issue
@Zih0 Zih0 pinned this issue Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation📂 Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant