9

I am trying to setup django-nonrel on GAE (Google App Engine) - following the steps here http://www.allbuttonspressed.com/projects/djangoappengine#installation

The test application works great -

I was able to use the cache API in the application, but not so for the tests and shell:

Attempting to from django.core.cache import cache in the shell gives me:

>>> from django.core.cache import cache
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "django-testapp/django/core/cache/__init__.py", line 182, in <module>
    cache = get_cache(DEFAULT_CACHE_ALIAS)
  File "django-testapp/django/core/cache/__init__.py", line 180, in get_cache
    return backend_cls(location, params)
  File "django-testapp/django/core/cache/backends/memcached.py", line 154, in __init__
    import memcache
ImportError: No module named memcache

Similarly attempting ./manage.py test fails the same way.

Any idea why ./manage runserver works fine, but ./manage shell or ./manage test fails to import cache?

Iftah
  • 9,512
  • 2
  • 33
  • 45

3 Answers3

41

I had the same problem when I upgraded to Google App Engine 1.6.0 from 1.5.5 .

I solved the problem by installing python-memcached:

pip install python-memcached
Nilesh
  • 20,521
  • 16
  • 92
  • 148
Matej Puntar
  • 597
  • 5
  • 7
0

For gentoo users it's recommended:
emerge -av dev-python/python-memcached

Pavel
  • 39
  • 3
0

I alse do like this:

sudo pip install python-memcached

then restart the django, it works.

JSmith
  • 31
  • 1
  • 6