add RESET_DB back

This commit is contained in:
Son NK 2019-12-08 15:52:44 +01:00
parent ba85351e3a
commit 2e23a1bf19
2 changed files with 6 additions and 3 deletions

View file

@ -24,6 +24,7 @@ if config_file:
else: else:
load_dotenv() load_dotenv()
RESET_DB = "RESET_DB" in os.environ
# Allow user to have 1 year of premium: set the expiration_date to 1 year more # Allow user to have 1 year of premium: set the expiration_date to 1 year more
PROMO_CODE = "SIMPLEISBETTER" PROMO_CODE = "SIMPLEISBETTER"

View file

@ -20,6 +20,7 @@ from app.config import (
URL, URL,
SHA1, SHA1,
PADDLE_MONTHLY_PRODUCT_ID, PADDLE_MONTHLY_PRODUCT_ID,
RESET_DB,
) )
from app.dashboard.base import dashboard_bp from app.dashboard.base import dashboard_bp
from app.developer.base import developer_bp from app.developer.base import developer_bp
@ -379,9 +380,10 @@ if __name__ == "__main__":
# app.config["SQLALCHEMY_ECHO"] = True # app.config["SQLALCHEMY_ECHO"] = True
# warning: only used in local # warning: only used in local
# LOG.d("reset db, add fake data") if RESET_DB:
# with app.app_context(): LOG.warning("reset db, add fake data")
# fake_data() with app.app_context():
fake_data()
if URL.startswith("https"): if URL.startswith("https"):
LOG.d("enable https") LOG.d("enable https")