Spaces:
Sleeping
Sleeping
| from flask import Flask | |
| from config import Config | |
| from .models import db | |
| def create_app(config_class=Config): | |
| app = Flask(__name__) | |
| app.config.from_object(config_class) | |
| db.init_app(app) | |
| with app.app_context(): | |
| from . import routes # Import routes | |
| # db.drop_all() # Uncomment if you need to reset the DB | |
| db.create_all() # Create sql tables for our data models | |
| routes.register_routes(app) # Register the routes | |
| # Register blueprints here if you plan to use them | |
| # from .main import bp as main_bp | |
| # app.register_blueprint(main_bp) | |
| return app | |