#23084: uWSGI raises django.core.exceptions.AppRegistryNotReady
------------------------------+----------------------
     Reporter:  kmmbvnr@…     |      Owner:  nobody
         Type:  Bug           |     Status:  new
    Component:  Core (Other)  |    Version:  1.7-rc-1
     Severity:  Normal        |   Keywords:
 Triage Stage:  Unreviewed    |  Has patch:  0
Easy pickings:  0             |      UI/UX:  0
------------------------------+----------------------
 I did uwsgi setup as listed here - http://smidth.ru/blog/django/django-
 nginx-uwsgi-supervisor/ with django 1.7 and following wsgi.ini


 {{{
 [uwsgi]
 home=/project_path/env/
 chdir=/project_path
 master=True
 disable-logging=True
 vacuum=True
 pidfile=/project_path/project.pid
 max-requests=5000
 socket=127.0.0.1:49001
 processes=2
 harakiri = 20

 pythonpath=/project_path/
 env=DJANGO_SETTINGS_MODULE=project.settings
 module=django.core.handlers.wsgi:WSGIHandler()
 touch-reload=/project_path/deploy/reload
 }}}

 I have to set DEBUG to False in order to see the real exception


 {{{
 traceback (most recent call last):
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/core/handlers/wsgi.py", line 187, in __call__
     response = self.get_response(request)
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/core/handlers/base.py", line 199, in get_response
     response = self.handle_uncaught_exception(request, resolver,
 sys.exc_info())
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/core/handlers/base.py", line 243, in
 handle_uncaught_exception
     return callback(request, **param_dict)
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/utils/decorators.py", line 105, in _wrapped_view
     response = view_func(request, *args, **kwargs)
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/views/defaults.py", line 44, in server_error
     template = loader.get_template(template_name)
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/template/loader.py", line 144, in get_template
     template, origin = find_template(template_name, dirs)
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/template/loader.py", line 126, in find_template
     loader = find_template_loader(loader_name)
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/template/loader.py", line 98, in find_template_loader
     TemplateLoader = import_string(loader)
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/utils/module_loading.py", line 26, in import_string
     module = import_module(module_path)
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/importlib/__init__.py",
 line 90, in import_module
     return _bootstrap._gcd_import(name[level:], package, level)
   File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
   File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
   File "<frozen importlib._bootstrap>", line 1532, in
 _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
   File "<frozen importlib._bootstrap>", line 1022, in load_module
   File "<frozen importlib._bootstrap>", line 1003, in load_module
   File "<frozen importlib._bootstrap>", line 560, in
 module_for_loader_wrapper
   File "<frozen importlib._bootstrap>", line 868, in _load_module
   File "<frozen importlib._bootstrap>", line 313, in
 _call_with_frames_removed
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/template/loaders/app_directories.py", line 33, in <module>
     app_template_dirs = calculate_app_template_dirs()
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/template/loaders/app_directories.py", line 21, in
 calculate_app_template_dirs
     for app_config in apps.get_app_configs():
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/apps/registry.py", line 125, in get_app_configs
     self.check_ready()
   File "/srv/viewflow.io/.tox/py33/lib/python3.3/site-
 packages/django/apps/registry.py", line 119, in check_ready
     raise AppRegistryNotReady()
 django.core.exceptions.AppRegistryNotReady
 }}}


 It could be fixed by adding following lines on top of
 django.core.handlers.wsgi.py

 {{{
 import django
 django.setup()
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23084>
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/060.c565453b3e58396de80b91e7976a9665%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to