You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Wondering if you have a code example of how to do a file upload with Django (getting the file from the user, maybe examining it, and then uploading to gcs).
The text was updated successfully, but these errors were encountered:
im trying to upload pdf files but i get Server Error (500)
my function to upload files in my views.py is:
def uploadFiles(request, id):
if not request.user.is_superuser and request.user.is_staff:
if request.method == 'POST':
form = StudentFilesForm(request.POST, request.FILES)
if form.is_valid():
form.save()
return redirect('detailRequest', id)
so, which can be the problem i have?
there are my vars in my settings.py:
if os.getenv('GAE_APPLICATION', None):
GOOGLE_CLOUD_STORAGE_BUCKET = 'media_examenes_sinodales' # the name of the bucket you have created from the google cloud storage console
GOOGLE_CLOUD_STORAGE_URL = 'https://console.cloud.google.com/storage/browser/media_examenes_sinodales' #'http://storage.googleapis.com/bucket' #whatever the ulr for accessing your cloud storgage bucket
GOOGLE_CLOUD_STORAGE_DEFAULT_CACHE_CONTROL = 'public, max-age: 7200' # default cache control headers for your files
DEFAULT_FILE_STORAGE = 'django_google_cloud_storage.GoogleCloudStorage'
Hello,
Wondering if you have a code example of how to do a file upload with Django (getting the file from the user, maybe examining it, and then uploading to gcs).
The text was updated successfully, but these errors were encountered: