Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7984417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:15:46+00:00 2026-06-04T11:15:46+00:00

I’m using this plugin to upload multiple files with jquery, and this project is

  • 0

I’m using this plugin to upload multiple files with jquery, and this project is for Django, but now I’m trying to use App Engine datastore.

I had success deploying and it works until I try to upload, an error message shows in server log:

ValueError: The App Engine storage backend only supports BlobstoreFile
instances or File instances whose file attribute is a BlobstoreFile.

I believe that the error is because in models.py it uses django’s model class, which is models.FileField, but AppEngine requires db.BlobProperty().

Here is the project link: https://github.com/sigurdga/django-jquery-file-upload

Here is my models.py file:

from django.db import models

class Picture(models.Model):

    # This is a small demo using FileField instead of ImageField, not
    # depending on PIL. You will probably want ImageField in your app.
    file = models.FileField(upload_to="pictures")
    slug = models.SlugField(max_length=50, blank=True)

    def __unicode__(self):
        return self.file

    @models.permalink
    def get_absolute_url(self):
        return ('upload-new', )

    def save(self, *args, **kwargs):
        self.slug = self.file.name
        super(Picture, self).save(*args, **kwargs)

Any idea to fix it? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:15:49+00:00Added an answer on June 4, 2026 at 11:15 am

    Ok there are a number of things worth noting here, which go right to the core of how App Engine works.

    Django’s Model layer is only designed to work with relational databases, like MySQL, SQLite, Postgres, Oracle, etc.

    App Engine’s Datastore is non-relational, so doesn’t work with Django Models natively. You could, however, use Django-nonrel, which acts as a translation layer between Django models and non-relational databases, like the Datastore.

    Unfortunately it’s still not quite as simple as that because the Django FileField doesn’t exactly fit the AppEngine BlobProperty. There are workarounds, but the Datastore isn’t great for serving images anyway.

    Storing the image

    Google recommend 2 ways of storing and serving files, such as images: the Blobstore and Google Cloud Storage.

    Ultimately, the best way to store uploaded images is to store them in one or other of these and then record a link to the image on your model. So if you changed your model to:

    class Picture(models.Model):
    
        file_url = models.URLField()
        slug = models.SlugField(max_length=50, blank=True)
    
        ...
    

    In your view, use the techniques described here for uploading a file to the Blobstore, then save the upload_url on the model as the file_url field.

    You could do the same with Google Cloud Storage, although as the Blobstore is actually part of App Engine (rather than than an API into another service) it gives you various benefits, described below.

    Note that, as described above, this will only work if you use Django-nonrel, otherwise you won’t be able to save your Django model to the Datastore.

    Storing the model

    With Django-nonrel, you can just save the model above in the Datastore as-is. However, Django-nonrel has a number of caveats which can take getting used to and it can be quite slow. I personally wouldn’t recommend it for new projects, but others may disagree.

    Alternatively, you could sidestep Django’s model layer and use App Engine’s own Model layer, which is designed to fit perfectly with the Datastore. It includes a specific property type for referencing objects in the Blobstore. Your model might look like this:

    from google.appengine.ext.blobstore import blobstore
    from google.appengine.ext import db
    
    class Picture(db.Model):
    
        file = blobstore.BlobReferenceProperty()
        slug = db.StringProperty(required=False)
    
        ...
    

    The BlobReferenceProperty gives you a lot more power than just storing a URL, because you can access the file data itself via this property, to get data about the file (size, etc) or process it. If you’re happy just storing the URL, there’s also a db.LinkProperty which is similar to Django’s models.URLField.

    Of course using App Engine models instead of Django models loses a lot of the benefits of Django’s model layer and the close integration it offers with Django.

    Google Cloud SQL

    There is another option if you’d like to use Django models but don’t want to use Django-nonrel. If you’re happy to forgo the benefits of the non-relational Datastore, you could use Google Cloud SQL instead. Django supports Cloud SQL natively. However, Google Cloud SQL is currently in limited preview so you might find it hard to get access.

    If you do decide to use Cloud SQL, you should still store your images in the Blobstore or Google Cloud Storage as discussed above if you wish to serve them publicly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Paperclip to handle profile photo uploads in my app. They upload
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.