Hi I am trying to integrate my django 1.4.1 app with Gunicorn 0.14.6. I start gunicorn server from command line like so -
gunicorn -c /home/code/gunicorn_co
Your django_settings
is incorrect. django_settings
should be in the form of a python module import that is importable from the Python path you set. So
pythonpath = '/home/code/po'
django_settings = 'po.settings'
To elaborate a bit more, application
is the default variable (which should be a WSGI application object) gunicorn will try and import from the Python module that you supply.
So to think about it another way. Say you were trying to run a simple Flask wsgi appication. The actual WSGI app was defined as application
and lived inside /home/code/views.py
. Then the following would manually start serving it with gunicorn
export PYTHONPATH=/home/code
gunicorn -w 2 views:application
So the variable application inside the views module. You can read about how Django provides you with the application object.
It might be that you need to point gunicorn at the po.wsgi
module itself. It's a little hard to tell from the information provided so far. If that module was created properly it should contain a variable called application
Check if another package you have installed already contains a file called wsgi.py. (gevent does.) If so, likely the wrong wsgi.py file is being loaded. Try renaming your wsgi.py file to something else (e.g. app_wsgi.py) and add run your app using
gunicorn -c /home/code/gunicorn_config.py app_wsgi