gae-python-gcm icon indicating copy to clipboard operation
gae-python-gcm copied to clipboard

django cache and settings error

Open elsigh opened this issue 12 years ago • 2 comments

Any reason gcm.py opts for django's cache module instead of using GAE's memcache one?

I don't use django and had to edit gcm.py to replace cache with memcache.

Thanks for this by the way!

elsigh avatar Jun 12 '13 00:06 elsigh

I got same error.

File "/base/data/home/apps/s~xxxx/1.372597888987958486/gae_python_gcm/gcm.py", line 21, in <module>
    from django.core.cache import cache

File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/core/cache/__init__.py", line 76, in <module>
    if not settings.CACHES:

File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/utils/functional.py", line 184, in inner
    self._setup()

File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/conf/__init__.py", line 40, in _setup
    raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)

ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

I don't use django too.

yosukesuzuki avatar Dec 26 '13 05:12 yosukesuzuki

yup get the same error you have to delete the cache and replace it with memcache and for importing change to from google.appengine._internal.django.utils import importlib and delete the import setting part so there will be no error

hone5t avatar Mar 16 '14 12:03 hone5t