Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -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
18 changes: 1 addition & 17 deletions app/config.py
Original file line number Diff line number Diff line change
@@ -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'
1 change: 1 addition & 0 deletions app/routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@main.route('/')\ndef index():\n return "Hello, World!"
1 change: 1 addition & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from app import create_app\nif __name__ == '__main__':\n app = create_app()\n app.run(debug=True)
Loading