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:
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
PROMO_CODE = "SIMPLEISBETTER"

View File

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