Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
development:python:django:deploy [2020/02/27 17:10] kalenpw created |
development:python:django:deploy [2021/06/29 15:02] (current) kalenpw |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Deploy ====== | ====== Deploy ====== | ||
| + | |||
| + | ---- | ||
| + | - Set up virtualenv | ||
| + | - Install gunicorn '' | ||
| + | - Set '' | ||
| + | - Set '' | ||
| + | - Collect static images to one directory '' | ||
| + | - Run gunicorn '' | ||
| + | |||
| + | Example Nginx config | ||
| + | <file nginx blog.kalen.pw> | ||
| + | server { | ||
| + | server_name blog.kalen.pw; | ||
| + | |||
| + | location = / | ||
| + | |||
| + | location /static/ { | ||
| + | root / | ||
| + | } | ||
| + | |||
| + | location / { | ||
| + | include proxy_params; | ||
| + | proxy_pass http:// | ||
| + | } | ||
| + | |||
| + | listen 443 ssl; # managed by Certbot | ||
| + | ssl_certificate / | ||
| + | ssl_certificate_key / | ||
| + | include / | ||
| + | ssl_dhparam / | ||
| + | } | ||
| + | |||
| + | server { | ||
| + | if ($host = blog.kalen.pw) { | ||
| + | return 301 https:// | ||
| + | } # managed by Certbot | ||
| + | |||
| + | server_name blog.kalen.pw; | ||
| + | listen 80; | ||
| + | return 404; # managed by Certbot | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | ---- | ||