প্রোডাকসান সার্ভার (Nginx) এবং জ্যাঙ্গো
Last updated
$ sudo touch webapp server {
listen 8000;
server_name 0.0.0.0;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/(user-name)/(project);
}
location / {
include proxy_params;
proxy_pass http://unix:/home/(user-name)/(project)/(project).sock;
}
}$ sudo ln -s /etc/nginx/sites-available/webapp /etc/nginx/sites-enabled$ sudo service nginx restart $ cd ~/webapp/$ pip install gunicorn
# In my pc, python3 is default. so it works. If you have python 2 as default,
# use: pip3 install gunicorn$ gunicorn --daemon --workers 1 --bind unix:/home/(username)/(project)/(project).sock (project).wsgi$ gunicorn3 --daemon --workers 1 --bind unix:/home/fahimfarhan/webapp/webapp.sock webapp.wsgi