I’m trying do deploy a django project. I tried a lot of tutorials, but had no luck. I use a new clean Ubuntu 11.10. I’ve performed
apt-get install nginx
apt-get install uwsgi
service nginx start
I’ve created folder /deploy/project1 and put there manage.py and other files.
My current /deploy/project1/project1/wsgi.py contains:
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project1.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
So, could you tell me how to deploy my django app for domain.com properly?
I’ve also installed Django via pip and easy_install
What should I add in /etc/nginx/sites-enabled/default.
Assuming that you have installed all requirement and you are using the aptitude packages then you don’t need the wsgi.py. All the configuration is in the uwsgi ini/xml/yaml file. (take the format that you prefer).
Here is a minimal example for
example.comfile for nginx(/etc/nginx/sites-available/examplecom for ubuntu 11.10)Create a symbolic link to /etc/nginx/sites-enabled
or
You are done with NGINX.
Go to
/etc/uwsgi/apps-availableand create your ini filePoint your ini to /etc/uwsgi/apps-enabled/projectname.ini
For more information, see any of these files on your system:
You are done. You can now restart nginx & uwsgi
Cheers!