mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-25 08:41:00 +00:00
Add ability to customise Django settings (#292)
This commit is contained in:
parent
ca40a0d150
commit
b63ad40f54
2 changed files with 9 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -13,6 +13,7 @@
|
||||||
/docs/_build
|
/docs/_build
|
||||||
/media/
|
/media/
|
||||||
/static-collected
|
/static-collected
|
||||||
|
/takahe/local_settings.py
|
||||||
__pycache__/
|
__pycache__/
|
||||||
api-test.*
|
api-test.*
|
||||||
fly.toml
|
fly.toml
|
||||||
|
|
|
@ -64,9 +64,12 @@ class Settings(BaseSettings):
|
||||||
#: Should django run in debug mode?
|
#: Should django run in debug mode?
|
||||||
DEBUG: bool = False
|
DEBUG: bool = False
|
||||||
|
|
||||||
# Should the debug toolbar be loaded?
|
#: Should the debug toolbar be loaded?
|
||||||
DEBUG_TOOLBAR: bool = False
|
DEBUG_TOOLBAR: bool = False
|
||||||
|
|
||||||
|
#: Should we atttempt to import the 'local_settings.py'
|
||||||
|
LOCAL_SETTINGS: bool = False
|
||||||
|
|
||||||
#: Set a secret key used for signing values such as sessions. Randomized
|
#: Set a secret key used for signing values such as sessions. Randomized
|
||||||
#: by default, so you'll logout everytime the process restarts.
|
#: by default, so you'll logout everytime the process restarts.
|
||||||
SECRET_KEY: str = Field(default_factory=lambda: secrets.token_hex(128))
|
SECRET_KEY: str = Field(default_factory=lambda: secrets.token_hex(128))
|
||||||
|
@ -405,3 +408,7 @@ TAKAHE_USER_AGENT = (
|
||||||
f"python-httpx/{httpx.__version__} "
|
f"python-httpx/{httpx.__version__} "
|
||||||
f"(Takahe/{__version__}; +https://{SETUP.MAIN_DOMAIN}/)"
|
f"(Takahe/{__version__}; +https://{SETUP.MAIN_DOMAIN}/)"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if SETUP.LOCAL_SETTINGS:
|
||||||
|
# Let any errors bubble up
|
||||||
|
from .local_settings import * # noqa
|
||||||
|
|
Loading…
Reference in a new issue