Skip to content

Instantly share code, notes, and snippets.

@1vank1n
Created July 7, 2022 11:19
Show Gist options
  • Select an option

  • Save 1vank1n/12c26c9e9ca73b1a820133166c8f6d74 to your computer and use it in GitHub Desktop.

Select an option

Save 1vank1n/12c26c9e9ca73b1a820133166c8f6d74 to your computer and use it in GitHub Desktop.
Template configs for production launch Django project / il-studio.ru
cd /web/project/
source /web/project/.env/bin/activate
git pull
pip install -r requirements/staging.txt
python ./manage.py migrate
python ./manage.py collectstatic --noinput
# python ./manage.py test
touch /tmp/project.conf
server {
listen 80;
server_name project.ru;
rewrite_log on;
error_log /web/log/nginx/project.ru-error.log warn;
access_log /web/log/nginx/project.ru-access.log;
location /static/ {
alias /web/project/static_nginx/;
expires 1y;
}
location /media/ {
root /web/project;
expires 1y;
}
location /robots.txt {
root /web/project;
}
location /.well-known {
root /web/project;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/web/run/project.sock;
}
}
[program:project]
command=/web/project/.env/bin/uwsgi /web/project/uwsgi.ini
stdout_logfile=/web/log/uwsgi/project.log
stderr_logfile=/web/log/uwsgi/project_err.log
autostart=true
autorestart=true
redirect_stderr=true
stopwaitsecs=60
stopsignal=INT
user=web
[uwsgi]
home=/web/project/.env
chdir=/web/project
module=settings.wsgi:application
master=True
disable-logging=True
pidfile=/web/pid/project.pid
socket=/web/run/project.sock
vacuum=True
max-requests=5000
uid=web
gid=web
chmod-socket=666
touch-reload=/tmp/project.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment