]> git.lizzy.rs Git - cheatdb.git/commitdiff
Use bash script to start server
authorrubenwardy <rw@rubenwardy.com>
Sat, 24 Mar 2018 02:36:14 +0000 (02:36 +0000)
committerrubenwardy <rw@rubenwardy.com>
Sat, 24 Mar 2018 02:36:14 +0000 (02:36 +0000)
.gitignore
app/__init__.py
rundebug.py [deleted file]
rundebug.sh [new file with mode: 0755]
runprod.py [deleted file]
runprod.sh [new file with mode: 0755]
setup.py

index ef0fa99499cdcf59f48eb170234e9cc0380d942d..b6243fb4ed54203c9677748c004b00392413dc5e 100644 (file)
@@ -1,4 +1,5 @@
 config.cfg
+config.prod.cfg
 *.sqlite
 main.css
 tmp
index 1031c930bb507c612975c55f3c233df2aec2b731..d9c2b384a14f6c8b9726f037f92b09742336348e 100644 (file)
@@ -3,9 +3,10 @@ from flask_user import *
 import flask_menu as menu
 from flask.ext import markdown
 from flask_github import GitHub
+import os
 
 app = Flask(__name__)
-app.config.from_pyfile("../config.cfg")
+app.config.from_pyfile(os.environ["FLASK_CONFIG"])
 
 menu.Menu(app=app)
 markdown.Markdown(app, extensions=["fenced_code"])
diff --git a/rundebug.py b/rundebug.py
deleted file mode 100644 (file)
index 292c33f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from app import app
-
-app.run(host="127.0.0.1", port=5000, debug=True)
diff --git a/rundebug.sh b/rundebug.sh
new file mode 100755 (executable)
index 0000000..2427059
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+FLASK_APP=app/__init__.py FLASK_CONFIG=../config.cfg FLASK_DEBUG=1 python3 -m flask run
diff --git a/runprod.py b/runprod.py
deleted file mode 100644 (file)
index 9132b74..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-from app import app
-
-app.run(host="0.0.0.0", port=5123, debug=False)
diff --git a/runprod.sh b/runprod.sh
new file mode 100755 (executable)
index 0000000..9951516
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+FLASK_APP=app/__init__.py FLASK_CONFIG=../config.prod.cfg FLASK_DEBUG=0 python3 -m flask run -h 0.0.0.0 -p 5123
index f7821421b9bab5eb4cc0d4f6902693a3d56eb805..eed19cb7db344b80c5ae6189b05103e299ee86a8 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@ if not os.path.isfile("db.sqlite"):
        jeija = User("Jeija")
        jeija.github_username = "Jeija"
        db.session.add(jeija)
-        
+
        sam = User("fillthisinlater")
        sam.github_username = "fillthisinlater"
        sam.rank = UserRank.EDITOR