create folders from config if they dont exist so user doesnt have to
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user