I am trying to deploy my django project to GAE. After deploying using appcfg.py I get this error inside GAE. Does anybody know how to solve this problem?
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime
/wsgi.py", line 223, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django
/core/handlers/wsgi.py", line 219, in __call__
self.load_middleware()
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django
/core/handlers/base.py", line 47, in load_middleware
raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' %
(mw_module, e))
ImproperlyConfigured: Error importing middleware django.middleware.cache: "No module
named memcache"
The next code shows how the middleware classes are imported in my project.settings:
from djangoappengine.settings_base import *
....
MIDDLEWARE_CLASSES = (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
Thanks for looking into this.
Install memcache with
pip install python-memcached
Your caching backend is probably configured to use memcache. Memcache is now available on google-appengine. You need to use memcache wrapper from appengine api google.appengine.api.memcache.
You will need to use a custom cache backend with django. You might need to implement your own django cache backend which uses appengine's memcache api. Implementing a django backend should be trivial because functions from appengine api maps easily to django cache backend. When writing a backend as a reference you can use django.core.cache.backends.MemcachedCache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With