From 0931dbea899e8c32c72a02d7201fa896a2342ccb Mon Sep 17 00:00:00 2001 From: Llloooggg Date: Sat, 17 Jul 2021 15:21:54 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B1=D0=B0=D0=B7=D1=8B=20=D0=B4=D0=B0=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D1=85=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BD=D0=B5=D1=81=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=B2=20=D0=BE=D1=81=D0=BD=D0=BE=D0=B2=D0=BD?= =?UTF-8?q?=D0=BE=D0=B9=20=D0=BA=D0=BE=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dyxless/__init__.py | 4 ++++ startserver.bat | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dyxless/__init__.py b/dyxless/__init__.py index e30747f..4c70c76 100644 --- a/dyxless/__init__.py +++ b/dyxless/__init__.py @@ -1,3 +1,4 @@ +import os import json from flask import Flask @@ -55,3 +56,6 @@ app.register_blueprint(main_blueprint) from .mails import mails as mails_blueprint app.register_blueprint(mails_blueprint) + +if not os.path.exists(app.config["SQLALCHEMY_DATABASE_URI"]): + db.create_all(app=app) diff --git a/startserver.bat b/startserver.bat index 2b8708a..46999a8 100644 --- a/startserver.bat +++ b/startserver.bat @@ -1,10 +1,6 @@ @echo off -if not exist "db.sqlite" ( - python init_db.py -) - set FLASK_APP=dyxless set FLASK_ENV=development