-
-
Notifications
You must be signed in to change notification settings - Fork 868
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
Adding handling of media files to the documentation #628
Comments
@kasperj93 I'm getting an error, google.auth.exceptions.RefreshError: ('invalid_grant: Invalid JWT Signature.', '{\n "error": "invalid_grant",\n "error_description": "Invalid JWT Signature."\n}') |
@aruljane . Can you provide some more information? |
@aruljane - There is probably something wrong with your service account file.
|
I have followed your steps in settings.py & config/storage_backends.py and i tried, ./manage.py collectstatic to test, and i got the following, ./manage.py collectstatic You have requested to collect static files at the destination This will overwrite existing files! Type 'yes' to continue, or 'no' to cancel: yes |
Do not do both. Since you are running locally, download the service account JSON and specify the GS_CREDENTIALS in settings.py. Delete any other mention of GOOGLE_APPLICATION_CREDENTIALS. I run this way every day. As a side note, you can not make the files private and the hack the URL like you have in the example code. It might work for you, but your users will not see the files. Since this is a support issue vs a bug. It might be better if you ask the question on Stackoverflow and post it here. |
@sww314 I disabled the the GOOGLE_APPLICATION_CREDENTIALS, and GS_DEFAULT_ACL as well. but still the same error :( |
Please post your code somewhere and move this to StackOverflow. No one can help you without seeing the details. |
@sww314 @kasperj93 Sorry guys, it was an issue with my GOOGLE_APPLICATION_CREDENTIALS json file. Once i created a new one with appropriate permission, things works like charm. :) |
Would it be possible to add documentation to the handling of media files?
It would have been really helpful in my case:
From @elnygren 's post on stackoverflow: https://stackoverflow.com/questions/34247702/configure-django-and-google-cloud-storage
and answer to #491
I struggled a lot with handling media files between a django website on an appengine and static files in google cloud storage (both static markup files and media files). After a long try, I finally managed to succeed with the following settings.
Credit to @elnygren!
In my settings.py I include the following:
Credit to @elnygren!
Creating a folder in the root directoy named 'config' I inserted the following 'storage_backends.py' file:
App engine already instantiate GOOGLE_APPLICATION_CREDENTIALS so for development, I added:
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "/path/to/service_account.json"
in my "dev settings"
The text was updated successfully, but these errors were encountered: