
- Implemented FastAPI application structure - Added OpenWeatherMap API integration - Created SQLite database with SQLAlchemy - Setup Alembic for database migrations - Added health check endpoint - Created comprehensive README generated with BackendIM... (backend.im)
19 lines
508 B
Python
19 lines
508 B
Python
import os
|
|
from pathlib import Path
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
# API Settings
|
|
API_V1_STR = "/api/v1"
|
|
PROJECT_NAME = "Weather Data API"
|
|
|
|
# OpenWeatherMap Settings
|
|
OPENWEATHERMAP_API_KEY = os.getenv("OPENWEATHERMAP_API_KEY", "bd5e378503939ddaee76f12ad7a97608")
|
|
OPENWEATHERMAP_BASE_URL = "https://api.openweathermap.org/data/2.5"
|
|
|
|
# Database Settings
|
|
DB_DIR = Path("/app") / "storage" / "db"
|
|
DB_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
SQLALCHEMY_DATABASE_URL = f"sqlite:///{DB_DIR}/db.sqlite" |