From 1261536737a699a3c8f8df8aeb51932f8a0d69c4 Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Thu, 4 Jun 2020 22:11:57 +0200 Subject: [PATCH] bootstrap make it work --- bootstrap/populate.py | 2 +- bootstrap/webapp/models/__init__.py | 0 oshipka.sh | 2 ++ requirements.txt | 1 + vm_gen/vm_gen.py | 4 ++-- 5 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 bootstrap/webapp/models/__init__.py diff --git a/bootstrap/populate.py b/bootstrap/populate.py index 22faf19..2db3117 100644 --- a/bootstrap/populate.py +++ b/bootstrap/populate.py @@ -1,4 +1,4 @@ -from webapp.models import db +from oshipka.persistance import db def populate_db(app): diff --git a/bootstrap/webapp/models/__init__.py b/bootstrap/webapp/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/oshipka.sh b/oshipka.sh index 03b5afc..0b02509 100755 --- a/oshipka.sh +++ b/oshipka.sh @@ -102,6 +102,8 @@ bootstrap() { mkdir -p ${PROJECT_PATH} cp -r ${OSHIPKA_PATH}/bootstrap/* ${PROJECT_PATH}/ cp ${OSHIPKA_PATH}/bootstrap/.gitignore ${PROJECT_PATH}/.gitignore + mkdir ${PROJECT_PATH}/data + mkdir ${PROJECT_PATH}/webapp/view_models cd ${PROJECT_PATH} init_venv link_dev_oshipka diff --git a/requirements.txt b/requirements.txt index 2205e1a..295150a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,7 @@ Flask-Login==0.5.0 Flask-Mail==0.9.1 Flask-Migrate==2.5.3 Flask-Principal==0.4.0 +Flask-Script==2.0.6 Flask-Security==3.0.0 Flask-SQLAlchemy==2.4.1 Flask-Table==0.5.0 diff --git a/vm_gen/vm_gen.py b/vm_gen/vm_gen.py index 3fc7bde..a64eee7 100644 --- a/vm_gen/vm_gen.py +++ b/vm_gen/vm_gen.py @@ -104,8 +104,8 @@ if __name__ == "__main__": WEBAPP_PATH = os.path.join(basepath, "webapp") VIEW_MODELS_PATH = os.path.join(WEBAPP_PATH, "view_models") MODELS_PATH = os.path.join(WEBAPP_PATH, "models") - if not os.path.exists(MODELS_PATH): - os.makedirs(MODELS_PATH) + for d in [VIEW_MODELS_PATH,MODELS_PATH ]: + os.makedirs(d, exist_ok=True) HTML_TEMPLATES_PATH = os.path.join(WEBAPP_PATH, "templates") env = Environment(