mirror of
https://github.com/Llloooggg/TextSouls.git
synced 2026-03-06 04:26:23 +03:00
Backend + Telegram: изменена структура проекта, добавлен эндпоинт для регистрации на бэкенде
This commit is contained in:
28
backend/textsouls/__init__.py
Normal file
28
backend/textsouls/__init__.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import json
|
||||
|
||||
from flask import Flask
|
||||
from flask_migrate import Migrate
|
||||
|
||||
from textsouls.models import db
|
||||
|
||||
app = Flask(
|
||||
"__name__",
|
||||
)
|
||||
|
||||
migrate = Migrate(app, db)
|
||||
|
||||
with open("textsouls/config.json") as config_file:
|
||||
config_data = json.load(config_file)
|
||||
|
||||
main_settings = config_data["main_settings"]
|
||||
app.config.update(main_settings)
|
||||
|
||||
db_settings = config_data["db_settings"]
|
||||
app.config.update(db_settings)
|
||||
|
||||
db.init_app(app)
|
||||
|
||||
|
||||
from .main import main as main_blueprint
|
||||
|
||||
app.register_blueprint(main_blueprint)
|
||||
Reference in New Issue
Block a user