mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 15:53:22 +08:00
add RESET_DB back
This commit is contained in:
parent
ba85351e3a
commit
2e23a1bf19
2 changed files with 6 additions and 3 deletions
|
@ -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"
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue