Skip to content

Commit

Permalink
Flask Deployment Snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
CoreyMSchafer committed Dec 20, 2018
1 parent 0a5183f commit 07ab838
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Python/Flask_Blog/snippets/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"SECRET_KEY": "YOUR_SECRET_KEY",
"SQLALCHEMY_DATABASE_URI": "sqlite:///site.db",
"EMAIL_USER": "YOUR_EMAIL",
"EMAIL_PASS": "YOUR_EMAIL_PASS"
}
14 changes: 14 additions & 0 deletions Python/Flask_Blog/snippets/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
server {
listen 80;
server_name YOUR_IP_OR_DOMAIN;

location /static {
alias /home/YOUR_USER/YOUR_PROJECT/flaskblog/static;
}

location / {
proxy_pass http://localhost:8000;
include /etc/nginx/proxy_params;
proxy_redirect off;
}
}
10 changes: 10 additions & 0 deletions Python/Flask_Blog/snippets/supervisor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[program:flaskblog]
directory=/home/YOUR_USER/YOUR_PROJECT
command=/home/YOUR_USER/YOUR_PROJECT/venv/bin/gunicorn -w 3 run:app
user=YOUR_USER
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
stderr_logfile=/var/log/flaskblog/flaskblog.err.log
stdout_logfile=/var/log/flaskblog/flaskblog.out.log

0 comments on commit 07ab838

Please sign in to comment.