swag-shop/app/__init__.py

26 lines
638 B
Python

from flask import Flask
from flask_jwt_extended import JWTManager
from flask_mail import Mail
from flasgger import Swagger
from flask_cors import CORS
app = Flask(__name__)
jwt_manager = JWTManager(app)
mail = Mail(app)
swag = Swagger(app)
cors = CORS(app)
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)
from app.config import FlaskTesting, FlaskProduction
app.config.from_object(FlaskTesting)
from . import jwt_utils
return app