diff --git a/app/__init__.py b/app/__init__.py index e69de29..2ad7da9 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -0,0 +1 @@ +from flask import Flask\nfrom .config import Config\nfrom .routes import main as main_blueprint\ndef create_app():\n app = Flask(__name__)\n app.config.from_object(Config)\n app.register_blueprint(main_blueprint)\n return app \ No newline at end of file diff --git a/app/config.py b/app/config.py index 805245e..2dacfce 100644 --- a/app/config.py +++ b/app/config.py @@ -1,17 +1 @@ -import logging -from functools import lru_cache - -from pydantic_settings import BaseSettings - - -log = logging.getLogger("uvicorn") - - -class Settings(BaseSettings): - environment: str = "dev" - testing: bool = 0 - -@lru_cache() -def get_settings() -> BaseSettings: - log.info("Loading config settings from the environment...") - return Settings() +class Config:\n DEBUG = False\n TESTING = False\n SECRET_KEY = 'your-secret-key' \ No newline at end of file diff --git a/app/routes.py b/app/routes.py new file mode 100644 index 0000000..71f486c --- /dev/null +++ b/app/routes.py @@ -0,0 +1 @@ +@main.route('/')\ndef index():\n return "Hello, World!" \ No newline at end of file diff --git a/run.py b/run.py new file mode 100644 index 0000000..8afa2ac --- /dev/null +++ b/run.py @@ -0,0 +1 @@ +from app import create_app\nif __name__ == '__main__':\n app = create_app()\n app.run(debug=True) \ No newline at end of file