I have an app built in Django and currently deployed on Google App Engine. Everything works fine except for when I want to upload files larger than 32MB. I get an error which says, 413. That’s an error.
I have been doing some research and I've come to realize that I have to use Google App Engine's Blobstore API. I have no idea on how to implement that on my Django App.
Currently my code looks something like this:
Model:
class FileUploads(models.Model):
title = models.CharField(max_length=200)
file_upload = models.FileField(upload_to="uploaded_files/", blank=True, null=True)
Form:
class UploadFileForm(forms.ModelForm):
class Meta:
model = FileUploads
fields = ["title", "file_upload"]
View:
def upload_file(request):
if request.method == "POST":
form = UploadFileForm(request.POST, request.FILES)
if form.is_valid():
form.save()
form = UploadFileForm()
return render(request, "my_app/templates/template.html", {"form": form})
Everything works fine. I would just like to know how to implement Google App Engine's Blobstore API on my current code structure to enable large file uploads.