WIP registration platform + discord bot
This commit is contained in:
21
app/__init__.py
Normal file
21
app/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from flask import Flask
|
||||
from app.config import Config
|
||||
from app.extensions import db, mail
|
||||
|
||||
def create_app(config_class=Config):
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(config_class)
|
||||
|
||||
# Initialize extensions
|
||||
db.init_app(app)
|
||||
mail.init_app(app)
|
||||
|
||||
# Register Blueprints
|
||||
from app.routes import bp as main_bp
|
||||
app.register_blueprint(main_bp)
|
||||
|
||||
# Create DB tables
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
|
||||
return app
|
||||
Reference in New Issue
Block a user