diff --git a/myriad/__init__.py b/myriad/__init__.py index 66be3d6..04ba5de 100644 --- a/myriad/__init__.py +++ b/myriad/__init__.py @@ -11,8 +11,13 @@ def create_app(): app.config.from_pyfile('config.py') app.config.from_mapping(DATABASE=os.path.join(app.instance_path, 'database.sqlite'),) - # ensure the instance folder exists + # ensure the necessary directories exist os.makedirs(app.instance_path, exist_ok=True) + os.makedirs(app.config["ICON_UPLOAD_FOLDER"], exist_ok=True) + os.makedirs(app.config["BLINKIES_UPLOAD_FOLDER"], exist_ok=True) + os.makedirs(app.config["STAMPS_UPLOAD_FOLDER"], exist_ok=True) + os.makedirs(app.config["MISC_UPLOAD_FOLDER"], exist_ok=True) + os.makedirs(app.config["TMP_FOLDER"], exist_ok=True) from . import db db.init_app(app)