#25034: Remove attempts to access settings at import time -------------------------------------+------------------------------------- Reporter: evansd | Owner: nobody Type: | Status: new Cleanup/optimization | Component: Uncategorized | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: | Unreviewed Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by evansd): I don't think that's true. Here's a minimal case to reproduce: {{{ $ python -c 'import django.core.cache' Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/dave/.virtualenvs/tmp-a5eec9fa521d379a/local/lib/python2.7 /site-packages/django/core/cache/__init__.py", line 34, in <module> if DEFAULT_CACHE_ALIAS not in settings.CACHES: File "/home/dave/.virtualenvs/tmp-a5eec9fa521d379a/local/lib/python2.7 /site-packages/django/conf/__init__.py", line 48, in __getattr__ self._setup(name) File "/home/dave/.virtualenvs/tmp-a5eec9fa521d379a/local/lib/python2.7 /site-packages/django/conf/__init__.py", line 42, in _setup % (desc, ENVIRONMENT_VARIABLE)) django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. }}} -- Ticket URL: <https://code.djangoproject.com/ticket/25034#comment:5> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.e18fff9898f9c2e694c161140164e7de%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.