Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
uwsgi --emperor /etc/uwsgi/sites-enabled<VirtualHost *:8080>
ServerAdmin admin@example.com
ServerName site1.example.com
ErrorLog /var/log/httpd/site1_error.log
CustomLog /var/log/httpd/site1_access.log common
WSGIScriptAlias / /home/httpd/site1/app/wsgi/django.wsgi
WSGIDaemonProcess user=site1 group=site1 processes=2 threads=1
WSGIProcessGroup site1
WSGIApplicationGroup site1
WSGIPassAuthorization On
description "uWSGI server for Project project_name"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /server/env/bin/uwsgi -p 2 --uid mechanism --home /server/env/ --socket /server/sock/project_name.uwsgi.sock --chmod-socket --module runsite --pythonpath /server/SITES/project_name --daemonize /server/log/project_name.uwsgi.log
import os, sys
current_directory = os.path.dirname(__file__)
parent_directory = os.path.dirname(current_directory)
module_name = os.path.basename(current_directory)
sys.path.append(parent_directory)
sys.path.append(current_directory)
os.environ["CELERY_LOADER"] = "django"
os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % module_name
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
«Почему uWSGI а не fastcgi?
Я последний использую, может у первого есть какие-то скрытые преимущества? )»
Nginx + uWSGI + virtualenv + Django на Debian Squeeze