import os

from flask import Flask
from flask_migrate import Migrate
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView

from stepik_delivery.auth import auth
from stepik_delivery.config import Config
from stepik_delivery.market import market
from stepik_delivery.models import db, Meal, Category, User, Order
from stepik_delivery.util.data import load_data

# Создание приложения
app = Flask(__name__)
app.config.from_object(Config)
app.secret_key = os.environ.get('SECRET_KEY')

# Инициализация базы данных
with app.app_context():
    db.init_app(app)

    # Подключаем миграции
    migrate = Migrate(app, db)

    # Загружаем данные блюд и их категорий
    load_data()

    # Админка
    admin = Admin(app)
    # Добавим экраны работы с данными
    for model in Meal, Category, User, Order:
        admin.add_view(ModelView(model, db.session))

    # Подключаем блюпринты
    app.register_blueprint(market)
    app.register_blueprint(auth)

af86e73ea3c1185aa5c3f3e140221e2172730abe
<mask token>

<mask token>
app.config.from_object(Config)
<mask token>
with app.app_context():
    db.init_app(app)
    migrate = Migrate(app, db)
    load_data()
    admin = Admin(app)
    for model in (Meal, Category, User, Order):
        admin.add_view(ModelView(model, db.session))
    app.register_blueprint(market)
    app.register_blueprint(auth)

<mask token>
app = Flask(__name__)
app.config.from_object(Config)
app.secret_key = os.environ.get('SECRET_KEY')
with app.app_context():
    db.init_app(app)
    migrate = Migrate(app, db)
    load_data()
    admin = Admin(app)
    for model in (Meal, Category, User, Order):
        admin.add_view(ModelView(model, db.session))
    app.register_blueprint(market)
    app.register_blueprint(auth)

import os
from flask import Flask
from flask_migrate import Migrate
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView
from stepik_delivery.auth import auth
from stepik_delivery.config import Config
from stepik_delivery.market import market
from stepik_delivery.models import db, Meal, Category, User, Order
from stepik_delivery.util.data import load_data
app = Flask(__name__)
app.config.from_object(Config)
app.secret_key = os.environ.get('SECRET_KEY')
with app.app_context():
    db.init_app(app)
    migrate = Migrate(app, db)
    load_data()
    admin = Admin(app)
    for model in (Meal, Category, User, Order):
        admin.add_view(ModelView(model, db.session))
    app.register_blueprint(market)
    app.register_blueprint(auth)

import os

from flask import Flask
from flask_migrate import Migrate
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView

from stepik_delivery.auth import auth
from stepik_delivery.config import Config
from stepik_delivery.market import market
from stepik_delivery.models import db, Meal, Category, User, Order
from stepik_delivery.util.data import load_data

# Создание приложения
app = Flask(__name__)
app.config.from_object(Config)
app.secret_key = os.environ.get('SECRET_KEY')

# Инициализация базы данных
with app.app_context():
    db.init_app(app)

    # Подключаем миграции
    migrate = Migrate(app, db)

    # Загружаем данные блюд и их категорий
    load_data()

    # Админка
    admin = Admin(app)
    # Добавим экраны работы с данными
    for model in Meal, Category, User, Order:
        admin.add_view(ModelView(model, db.session))

    # Подключаем блюпринты
    app.register_blueprint(market)
    app.register_blueprint(auth)
