Once you have created the dJango application. Just follow these steps:
1. , , uwsgi.ini Django Project Directory. manage.py
[uwsgi]
http = :<port_no>
chdir = <project directory>
pythonpath = /var/www
env = DJANGO_SETTINGS_MODULE=<project_name>.settings
module = django.core.handlers.wsgi:WSGIHandler()
2. /etc/nginx/sites-available .conf
server {
listen 84;
server_name example.com;
access_log /var/log/nginx/sample_project.access.log;
error_log /var/log/nginx/sample_project.error.log;
location /static/ {
alias /home/www/myhostname.com/static/;
expires 30d;
}
}
3. nginx.conf Django
{}
location /yourapp {
include uwsgi_params;
uwsgi_pass <your app address, eg.localhost>:<portno>;
}
4. uwsgi.ini
> uwsgi --ini uwsgi.ini
nGINX Django uwsgi. :)