Spaces:
Sleeping
Sleeping
Download app/__init__.py from GphaHoa/chinese_learning_v2: direct link, hf CLI and curl.
- Browser
- Download file 659 Bytes
-
https://huggingface.co/spaces/GphaHoa/chinese_learning_v2/resolve/main/app/__init__.py
- Command line
-
hf download hf://spaces/GphaHoa/chinese_learning_v2/app/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/GphaHoa/chinese_learning_v2/resolve/main/app/__init__.py
659 Bytes
| from flask import Flask | |
| from flask_cors import CORS | |
| def create_app(config_class=None): | |
| app = Flask(__name__) | |
| if config_class: | |
| app.config.from_object(config_class) | |
| CORS(app) | |
| # Register blueprints | |
| from app.routes.home import home_bp | |
| from app.routes.dictionary import dictionary_bp | |
| from app.routes.elearning import elearning_bp | |
| from app.routes.api import api_bp | |
| app.register_blueprint(home_bp) | |
| app.register_blueprint(dictionary_bp, url_prefix="/dictionary") | |
| app.register_blueprint(elearning_bp, url_prefix="/learn") | |
| app.register_blueprint(api_bp, url_prefix="/api") | |
| return app |