Add Docker support; add favicon
This commit is contained in:
parent
fd856d839b
commit
033c13e931
18 changed files with 264 additions and 107 deletions
|
|
@ -6,12 +6,10 @@ import sys
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import django_stubs_ext
|
||||
from dotenv import load_dotenv
|
||||
from platformdirs import user_data_dir
|
||||
|
||||
logger: logging.Logger = logging.getLogger("ttvdrops.settings")
|
||||
django_stubs_ext.monkeypatch()
|
||||
|
||||
load_dotenv(verbose=True)
|
||||
|
||||
|
|
@ -100,7 +98,7 @@ MEDIA_ROOT: Path = DATA_DIR / "media"
|
|||
MEDIA_ROOT.mkdir(exist_ok=True)
|
||||
MEDIA_URL = "/media/"
|
||||
|
||||
STATIC_ROOT: Path = BASE_DIR / "staticfiles"
|
||||
STATIC_ROOT: Path = DATA_DIR / "staticfiles"
|
||||
STATIC_ROOT.mkdir(exist_ok=True)
|
||||
STATIC_URL = "static/"
|
||||
STATICFILES_DIRS: list[Path] = [BASE_DIR / "static"]
|
||||
|
|
@ -181,18 +179,3 @@ DATABASES: dict[str, dict[str, str | Path | dict[str, str]]] = {
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
TESTING: bool = "test" in sys.argv or "PYTEST_VERSION" in os.environ
|
||||
|
||||
if not TESTING:
|
||||
DEBUG_TOOLBAR_CONFIG: dict[str, str] = {
|
||||
"ROOT_TAG_EXTRA_ATTRS": "hx-preserve",
|
||||
}
|
||||
INSTALLED_APPS = [ # pyright: ignore[reportConstantRedefinition]
|
||||
*INSTALLED_APPS,
|
||||
"debug_toolbar",
|
||||
]
|
||||
MIDDLEWARE = [ # pyright: ignore[reportConstantRedefinition]
|
||||
"debug_toolbar.middleware.DebugToolbarMiddleware",
|
||||
*MIDDLEWARE,
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,15 +15,6 @@ urlpatterns: list[URLResolver] | list[URLPattern | URLResolver] = [ # type: ign
|
|||
path(route="", view=include("twitch.urls", namespace="twitch")),
|
||||
]
|
||||
|
||||
if not settings.TESTING:
|
||||
# Import debug_toolbar lazily to avoid ImportError when not installed in testing environments
|
||||
from debug_toolbar.toolbar import debug_toolbar_urls # pyright: ignore[reportMissingTypeStubs]
|
||||
|
||||
urlpatterns = [
|
||||
*urlpatterns,
|
||||
*debug_toolbar_urls(),
|
||||
]
|
||||
|
||||
# Serve media in development
|
||||
if settings.DEBUG:
|
||||
urlpatterns += static(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue