Last active
August 29, 2015 14:27
-
-
Save katmutua/c36d9333cdfe9d3c6091 to your computer and use it in GitHub Desktop.
Django Deployment Settings | uwsgi, nginx, celery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [uwsgi] | |
| chdir={{project_home_dir}} | |
| mountpoint={{project_home_dir}} | |
| uid=www-data | |
| gid=www-data | |
| socket=127.0.0.1:8001 | |
| virtualenv={{virtual_env_dir}} | |
| master=True | |
| harakiri=20 | |
| pythonpath={{project_home_dir}} | |
| post-buffering=4096 | |
| vacuum=true | |
| module={{django_app_name}} | |
| env=DJANGO_SETTINGS_MODULE={{application}}.settings.common | |
| wsgi-file={{wsgi_file}} | |
| autostart=true | |
| autorestart=unexpected | |
| socket=127.0.0.1:8001 | |
| max-requests=5000 | |
| processes=2 | |
| logto =/etc/uwsgi/error.log | |
| enable-threads=true | |
| master=true | |
| ---------------------------------------------------------------------- | |
| ##nginx | |
| user www-data; | |
| worker_processes 4; | |
| pid /run/nginx.pid; | |
| events { | |
| worker_connections 768; | |
| multi_accept on; | |
| } | |
| http { | |
| sendfile on; | |
| tcp_nopush on; | |
| tcp_nodelay on; | |
| keepalive_timeout 64; | |
| types_hash_max_size 2048; | |
| include /etc/nginx/mime.types; | |
| default_type application/octet-stream; | |
| access_log /var/log/nginx/access.log; | |
| error_log /var/log/nginx/error.log; | |
| gzip on; | |
| gzip_disable "msie6"; | |
| gzip_vary on; | |
| gzip_proxied any; | |
| gzip_comp_level 6; | |
| gzip_buffers 16 8k; | |
| include /etc/nginx/conf.d/*.conf; | |
| } | |
| --------------------------------------------------------- | |
| #supervisor file | |
| [program:{{application_name}}] | |
| command=bash {{activate_app_script}} | |
| user=root | |
| directory={{project_home_dir}} | |
| stopasgroup=true | |
| killasgroup=true | |
| numprocs=1 | |
| logto=/etc/uwsgi/error.log | |
| redirect_stderr=true | |
| unmask=007 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment