Download app/__init__.py from rastof9/ads: direct link, hf CLI and curl.
- Browser
- Download file 965 Bytes
-
https://huggingface.co/spaces/rastof9/ads/resolve/main/app/__init__.py
- Command line
-
hf download hf://spaces/rastof9/ads/app/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/rastof9/ads/resolve/main/app/__init__.py
965 Bytes
| from flask import Flask | |
| from flask_sqlalchemy import SQLAlchemy | |
| from flask_login import LoginManager | |
| from celery import Celery | |
| import redis | |
| db = SQLAlchemy() | |
| login = LoginManager() | |
| celery = Celery(__name__) | |
| cache = redis.Redis() | |
| def create_app(): | |
| # Create the Flask app first | |
| app = Flask(__name__) | |
| # Load configuration | |
| app.config.from_object('config.Config') | |
| # Set the instance path after loading the config | |
| app.instance_path = app.config['INSTANCE_PATH'] | |
| # Initialize extensions | |
| db.init_app(app) | |
| login.init_app(app) | |
| celery.conf.update(app.config) | |
| # Register Blueprints | |
| from .routes.auth import auth_bp | |
| from .routes.dashboard import dashboard_bp | |
| from .routes.api import api_bp | |
| from .routes.compliance import compliance_bp | |
| app.register_blueprint(auth_bp) | |
| app.register_blueprint(dashboard_bp) | |
| app.register_blueprint(api_bp) | |
| app.register_blueprint(compliance_bp) | |
| return app |