Advertisement
Guest User

Untitled

a guest
Dec 8th, 2020
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. from flask import Flask
  2. from flask_sqlalchemy import SQLAlchemy
  3. from flask_bcrypt import Bcrypt
  4.  
  5. from .config import config_by_name
  6.  
  7. db = SQLAlchemy()
  8. flask_bcrypt = Bcrypt()
  9.  
  10.  
  11. def create_app(config_name):
  12. app = Flask(__name__)
  13. app.config.from_object(config_by_name[config_name])
  14. db.init_app(app)
  15. flask_bcrypt.init_app(app)
  16.  
  17. return app
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement