aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-11-12 22:36:30 +0000
committerrubenwardy <rw@rubenwardy.com>2019-11-12 22:36:30 +0000
commit904e09f0ddfcec987f74536d2bfac9eedc058b36 (patch)
tree0f5b06240aeb75525d9edd00806950041ea470a7
parent038ef5b73986cbc9ca0b1c715eb664cde6e4e45d (diff)
downloadcheatdb-904e09f0ddfcec987f74536d2bfac9eedc058b36.tar.xz
Create utils folder
-rw-r--r--README.md2
-rwxr-xr-xutils/rundebug.sh (renamed from rundebug.sh)0
-rwxr-xr-xutils/runprod.sh (renamed from runprod.sh)0
-rw-r--r--utils/runprodguni.sh (renamed from runprodguni.sh)0
-rw-r--r--utils/setup.py (renamed from setup.py)7
5 files changed, 7 insertions, 2 deletions
diff --git a/README.md b/README.md
index 21e4410..155d271 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ Note: you should first read one of the guides on the [Github repo wiki](https://
FLASK_CONFIG=../config.cfg celery -A app.tasks.celery worker
# if sqlite
-python setup.py -t
+python utils/setup.py -t
rm db.sqlite && python setup.py -t && FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db stamp head
# Create migration
diff --git a/rundebug.sh b/utils/rundebug.sh
index 31e9137..31e9137 100755
--- a/rundebug.sh
+++ b/utils/rundebug.sh
diff --git a/runprod.sh b/utils/runprod.sh
index c64450c..c64450c 100755
--- a/runprod.sh
+++ b/utils/runprod.sh
diff --git a/runprodguni.sh b/utils/runprodguni.sh
index 68c6962..68c6962 100644
--- a/runprodguni.sh
+++ b/utils/runprodguni.sh
diff --git a/setup.py b/utils/setup.py
index 4fd5ff1..bf9536b 100644
--- a/setup.py
+++ b/utils/setup.py
@@ -15,7 +15,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-import os, sys, datetime
+import os, sys, datetime, inspect
if not "FLASK_CONFIG" in os.environ:
os.environ["FLASK_CONFIG"] = "../config.cfg"
@@ -24,6 +24,11 @@ delete_db = len(sys.argv) >= 2 and sys.argv[1].strip() == "-d"
create_db = not (len(sys.argv) >= 2 and sys.argv[1].strip() == "-o")
test_data = len(sys.argv) >= 2 and sys.argv[1].strip() == "-t" or not create_db
+# Allow finding the `app` module
+currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
+parentdir = os.path.dirname(currentdir)
+sys.path.insert(0,parentdir)
+
from app.models import *
from app.utils import make_flask_user_password