Problem migration to server with gunicorn and nginx

40 views
Skip to first unread message

pythonista

unread,
Jan 2, 2015, 2:29:19 PM1/2/15
to django...@googlegroups.com
The application is working as expected in my development region, but when the admin migrates it to the server and starts up gnicorn and nginx, I get the following errror.

I would appreciate any assistance.

The application was running the first time we migrated 2 weeks ago to QA.

Not sure if the admin changed anything on the server side during the past 2 weeks.

Thanks in advance.



[2015-01-02 13:07:09 +0000] [20222] [DEBUG] GET /waitlist/

[2015-01-02 13:07:09 +0000] [20222] [ERROR] Error handling request

Traceback (most recent call last):

  File "/opt/python-2.7.8/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/workers/sync.py", line 93, in h                              andle

    self.handle_request(listener, req, client, addr)

  File "/opt/python-2.7.8/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/workers/sync.py", line 134, in                               handle_request

    respiter = self.wsgi(environ, resp.start_response)

  File "/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/handlers/wsgi.py", line 187, in                               __call__

    response = self.get_response(request)

  File "/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/handlers/base.py", line 199, in                               get_response

    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())

  File "/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/handlers/base.py", line 239, in                               handle_uncaught_exception

    if resolver.urlconf_module is None:

  File "/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/core/urlresolvers.py", line 366, in                               urlconf_module

    self._urlconf_module = import_module(self.urlconf_name)

  File "/opt/python-2.7.8/lib/python2.7/importlib/__init__.py", line 37, in import_module

    __import__(name)

  File "/opt/housing/housing/housing/urls.py", line 9, in <module>

    url(r'^waitlist/', include('waitlist.urls')),

  File "/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/conf/urls/__init__.py", line 28, in                               include

    urlconf_module = import_module(urlconf_module)

  File "/opt/python-2.7.8/lib/python2.7/importlib/__init__.py", line 37, in import_module

    __import__(name)

  File "/opt/housing/housing/waitlist/urls.py", line 2, in <module>

    from waitlist import views

  File "/opt/housing/housing/waitlist/waitlist/views.py", line 5, in <module>

    from models import *

  File "/opt/housing/housing/waitlist/waitlist/models.py", line 7, in <module>

    class Post(models.Model):

  File "/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/db/models/base.py", line 285, in __n                              ew__

    new_class._meta.apps.register_model(new_class._meta.app_label, new_class)

  File "/opt/python-2.7.8/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/apps/registry.py", line 213, in regi                              ster_model

    (model_name, app_label, app_models[model_name], model))

RuntimeError: Conflicting 'post' models in application 'waitlist': <class 'waitlist.waitlist.models.Post'> and <class 'w                              aitlist.waitlist.models.Post'>.

[2015-01-02 14:07:21 +0000] [20214] [DEBUG] 3 workers

[2015-01-02 14:07:36 +0000] [20214] [DEBUG] 3 workers

[midware@itd-qa-wt-lap2 logs]$

Collin Anderson

unread,
Jan 4, 2015, 2:38:03 PM1/4/15
to django...@googlegroups.com
Hi,

Does doing a full start/stop of gunicorn fix it?

This could be an issue with PYTHONPATH (aka sys.path) and imports.

What's the output of sys.path?

What's your rough file tree? Why the double waitlist directories? Which directories have __init__.py files?

How are you referencing "waitlist" in INSTALLED_APPS?

Collin
Reply all
Reply to author
Forward
0 new messages