Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

25 lignes
786 B

  1. # THIRD PARTY
  2. from flask import Flask
  3. from flask_cors import CORS
  4. from flask_sqlalchemy import SQLAlchemy
  5. from flask_jwt_extended import JWTManager, create_access_token
  6. from flask_marshmallow import Marshmallow
  7. # CONSTANTS IMPORT
  8. from .Constants import constants
  9. app = Flask(__name__, template_folder='../templates') # App initialization
  10. # DB URI
  11. uri = "mysql+pymysql://"+constants["mysql"]["user"]+":"+constants["mysql"]["password"]+"@"+constants["mysql"]["host"]+"/"+constants["mysql"]["db_name"]+"?&autocommit=false"
  12. # APP CONFIGURATIONS
  13. app.config["SQLALCHEMY_DATABASE_URI"] = uri
  14. app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
  15. app.config["JWT_SECRET_KEY"] = "use-a-secret-key"
  16. # INSTANCES
  17. cors = CORS(app)
  18. db = SQLAlchemy(app)
  19. jwt = JWTManager(app)
  20. ma = Marshmallow(app)