views:

61

answers:

2

I am trying to get the Django Shell working with the Google App Engine. Unfortunately, I am getting the following error:

AttributeError: type object 'RegistrationTestModel' has no attribute '_deferred'

Does anyone have any idea of how to fix this?

Stack trace:

WARNING:root:Could not read datastore data from /var/folders/X0/X0QgAfs7Hd8IcCVZOIkiCE+++TI/-Tmp-/django_content-sharer.datastore
WARNING:root:Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module named _imaging
Traceback (most recent call last):
  File "manage.py", line 30, in <module>
    execute_manager(settings)
  File "/Users/chris/Documents/workspace/ContentSharer/src/__init__.py", line 362, in execute_manager    
  File "/Users/chris/Documents/workspace/ContentSharer/src/__init__.py", line 303, in execute
  File "/Users/chris/Documents/workspace/ContentSharer2/src/django/core/management/base.py", line 195, in run_from_argv
  File "/Users/chris/Documents/workspace/ContentSharer2/src/django/core/management/base.py", line 222, in execute
  File "/Users/chris/Documents/workspace/ContentSharer2/src/django/core/management/base.py", line 351, in handle
  File "/Users/chris/Documents/workspace/ContentSharer/src/django/core/management/commands/shell.py", line 18, in handle_noargs
    loaded_models = get_models()
  File "/Users/chris/Documents/workspace/ContentSharer2/src/django/db/models/loading.py", line 166, in get_models
AttributeError: type object 'RegistrationTestModel' has no attribute '_deferred'
+1  A: 

It looks like you're trying to load a part of Django that depends on Django models. Django models do not work on App Engine, as they depend on a relational database.

Try django-nonrel instead.

Nick Johnson
I am just trying to get the shell working. I have no clue what `RegistrationTestModel` is. Does the shell work with Django Helper?
Casebash
I believe it does, but I'm not a Django user. All I know is that the stacktrace shows it trying to import the Django models library, and that doesn't work on App Engine.
Nick Johnson
+1  A: 

Are you using Django 1.1.2 with the helper? If so, the helper has not yet been updated for Django 1.1.2 yet. Be sure to get r105 or later of the helper. As a side note, Django 1.1.2 hasn't been installed on production for use_library yet, as far as I know.

Try using Django 1.1.1 until 1.1.2 is available on GAE production and the helper has been updated.

Patch is included in this ticket: http://code.google.com/p/google-app-engine-django/issues/detail?id=171

Update: the helper has been patched with r105 http://code.google.com/p/google-app-engine-django/source/detail?r=105

dar
Thanks, that is probably it
Casebash
I've included the patch for 1.1.2 in this ticket: http://code.google.com/p/google-app-engine-django/issues/detail?id=171
dar