Skip to content

Commit 07ab838

Browse files
committed
Flask Deployment Snippets
1 parent 0a5183f commit 07ab838

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"SECRET_KEY": "YOUR_SECRET_KEY",
3+
"SQLALCHEMY_DATABASE_URI": "sqlite:///site.db",
4+
"EMAIL_USER": "YOUR_EMAIL",
5+
"EMAIL_PASS": "YOUR_EMAIL_PASS"
6+
}

Python/Flask_Blog/snippets/nginx.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
server {
2+
listen 80;
3+
server_name YOUR_IP_OR_DOMAIN;
4+
5+
location /static {
6+
alias /home/YOUR_USER/YOUR_PROJECT/flaskblog/static;
7+
}
8+
9+
location / {
10+
proxy_pass http://localhost:8000;
11+
include /etc/nginx/proxy_params;
12+
proxy_redirect off;
13+
}
14+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[program:flaskblog]
2+
directory=/home/YOUR_USER/YOUR_PROJECT
3+
command=/home/YOUR_USER/YOUR_PROJECT/venv/bin/gunicorn -w 3 run:app
4+
user=YOUR_USER
5+
autostart=true
6+
autorestart=true
7+
stopasgroup=true
8+
killasgroup=true
9+
stderr_logfile=/var/log/flaskblog/flaskblog.err.log
10+
stdout_logfile=/var/log/flaskblog/flaskblog.out.log

0 commit comments

Comments
 (0)