0

I deployed a django project and everything works great on manage.py, but when I run the default gunicorn server via gunicorn projectname.wsgi, the registration form cannot be submitted and there is a 502 Bad Request Error.

Any ideas?

user1909186
  • 1,124
  • 2
  • 12
  • 26
  • 1
    Check your server logs. – Torsten Engelbrecht Nov 13 '13 at 14:18
  • Could you give me some more clues? I use nginx on the server and I've looked through error logs set to debug. Isn't manage.py supposed to use the same wsgi configs (from the auto-created wsgi.py) as gunicorn? – user1909186 Nov 13 '13 at 14:21
  • `manage.py` is not using the `wsgi.py`. Gunicorn does though. When you run with gunicorn there must be some logs for gunicorn (not nginx). – Torsten Engelbrecht Nov 14 '13 at 17:06
  • I figured out my particular problem, but I thought manage.py runserver uses the wsgi specified in the settings wsgi_application. The dev doc says this https://docs.djangoproject.com/en/dev/ref/django-admin/ Have things changed? – user1909186 Nov 15 '13 at 14:29
  • 1
    If you figured it out then please answer your own question, so others running into a similar problem get some help. Regarding `manage.py`: I am not sure which django version you are using, but in 1.5 they are not doing this yet (can only find it in the latest dev docs, but not in the 1.5 docs). I also digged through the django source and `manage.py` definitely does not use the `WSGI_APPLICATION` setting or the `wsgi.py` script. This probably changes in Django 1.6 (which I just found out was released couple days ago :P). – Torsten Engelbrecht Nov 16 '13 at 08:27

1 Answers1

0

manage.py runserver seems to boot the celery workers automatically while gunicorn.wsgi does not. Booting all the workers fixed the problem.

Thanks for the comments!

user1909186
  • 1,124
  • 2
  • 12
  • 26