views:

158

answers:

0

I'm new to django and Google App Engine, and I'm having trouble with using the datastore. Every time I make a query, such as

db.GqlQuery("SELECT * FROM Listing ORDER BY date DESC LIMIT 10")

I receive the error:

'WSGIRequest' object has no attribute 'user'

This error seems to be generated in context_processors.py within the django core. Now, the advice I've found on the Internet said to comment out user-related INSTALLED_APPS and MIDDLEWARE_CLASSES, but this does not seem to help. My code looks like this:

MIDDLEWARE_CLASSES = (
#    'django.middleware.common.CommonMiddleware',
#    'django.contrib.sessions.middleware.SessionMiddleware',
#    'django.contrib.auth.middleware.AuthenticationMiddleware',
#    'django.middleware.doc.XViewMiddleware',
)

INSTALLED_APPS = (
#    'django.contrib.auth',
    'django.contrib.contenttypes',
#    'django.contrib.sessions',
    'django.contrib.sites',
)

My Listing object is defined as the following (it had a author property earlier, but this is now commented out and the object was redefined with a new name):

class Listing(db.Model):
    #author = db.UserProperty()
    address = db.StringProperty()
    date = db.DateTimeProperty(auto_now_add=True)
    coords = db.GeoPtProperty()

Does anyone know what is causing this error, and how to fix it? Is it perhaps a case of having to reset the settings somehow?