Answer the question
In order to leave comments, you need to log in
How to start uwsgi server without console interception?
There is a bunch of django + uwsgi + nginx.
I usually start the server from the console - uwsgi and a set of arguments
uwsgi --socket mysite.sock --module mysite.wsgi --chmod-socket=666
Answer the question
In order to leave comments, you need to log in
Only recently I tried to deploy a small test project (I myself have only two months of experience in Python & Django). In the end, everything worked out, I launched uwsgi in the so-called "Emperor mode". Used virtual environment. Installed uwsgi (pip install) in the system, by the way, and not in venv.
The file /etc/init/uwsgi.conf is created with the content:
# Emperor uWSGI script
description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [06]
exec uwsgi --master --die-on-term --emperor /etc/uwsgi/vassals
# mysite_uwsgi.ini file
[uwsgi]
## process-related settings
# master
master = true
# maximum number of worker processes
processes = 3
# the socket (use the full path to be safe
socket = /home/user/virtualenvs/mysite/uwsgi.sock
# ... with appropriate permissions - may be needed
chmod-socket = 666
# clear environment on exit
vacuum = true
# user, group
uid=mysiteuser
gid=mysitegroup
## Django-related settings
# the virtualenv (full path)
home = /home/user/virtualenvs/mysite/
# the base directory (full path)
chdir = /home/user/virtualenvs/mysite/www
# Django's wsgi file
module = mysite.wsgi
Why run it like that?
Create config
/etc/nginx/sites-available/example.conf
Here is an example
[uwsgi]
plugins=python27
socket=/var/run/example.sock
virtualenv=/home/webapps/example.com/example/python/
module=wsgi
callable=app
pythonpath=/home/ilya/webapps/example.com/example
chdir=/home/ilya/webapps/example.com/example
sudo service uwsgi restart
for development, you can use screen. at least when you break ssh will not stop.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question