mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-22 15:36:44 +03:00
Damir Modyarov
21c02df7f0
* Implement short link redirect service * Silence linter where imports needs to be below setup * Improve unknown link error * Provide session to worker to convert it to user id * Remove main entrypoint in favor of uvicorn command * Add base path for relative URLs * Add docs on launching redirect service to README.md * Fix wrong task argument name * Lint service code
20 lines
443 B
Python
20 lines
443 B
Python
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class AppSettings(BaseSettings):
|
|
"""General configuration of the app."""
|
|
|
|
redirect_slug_cutoff: int = 3
|
|
|
|
relative_base: str = "http://127.0.0.1:8000"
|
|
database_url: str = "postgresql://postgres:postgres@127.0.0.1:5432/akarpov"
|
|
|
|
class Config:
|
|
env_prefix = ""
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
extra = "allow"
|
|
|
|
|
|
settings = AppSettings()
|