swag-shop/app/__init__.py

30 lines
692 B
Python
Raw Permalink Normal View History

2024-03-05 16:01:26 +01:00
from flask import Flask
from flask_jwt_extended import JWTManager
2024-03-10 21:41:48 +01:00
from flask_mail import Mail
2024-03-12 20:12:19 +01:00
from flasgger import Swagger
2024-03-13 13:43:34 +01:00
from app.doc.main_swag import main_swagger
2024-03-05 16:01:26 +01:00
app = Flask(__name__)
2024-03-14 22:13:52 +01:00
from app.config import FlaskTesting, FlaskProduction
2024-03-14 22:13:52 +01:00
app.config.from_object(FlaskTesting)
flask_mail = Mail(app)
2024-03-14 22:13:52 +01:00
jwt_manager = JWTManager(app)
2024-03-13 13:43:34 +01:00
swag = Swagger(app, template=main_swagger)
2024-03-05 16:01:26 +01:00
def create_app():
from app.api import bp, bp_errors, bp_product, bp_user, bp_cart
app.register_blueprint(bp)
app.register_blueprint(bp_errors)
app.register_blueprint(bp_product)
app.register_blueprint(bp_user)
app.register_blueprint(bp_cart)
2024-03-05 16:01:26 +01:00
from . import jwt_utils
return app