Move Twitch stuff to /twitch/

This commit is contained in:
Joakim Hellsén 2026-03-16 15:27:33 +01:00
commit 6f6116c3c7
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
31 changed files with 1150 additions and 984 deletions

View file

@ -140,6 +140,7 @@ INSTALLED_APPS: list[str] = [
"django.contrib.postgres",
"twitch.apps.TwitchConfig",
"kick.apps.KickConfig",
"core.apps.CoreConfig",
]
MIDDLEWARE: list[str] = [

View file

@ -34,8 +34,10 @@ def _reload_urls_with(**overrides) -> ModuleType:
def test_top_level_named_routes_available() -> None:
"""Top-level routes defined in `config.urls` are reversible."""
assert reverse("sitemap") == "/sitemap.xml"
# ensure the included `twitch` namespace is present
assert reverse("twitch:dashboard") == "/"
msg: str = f"Expected 'twitch:dashboard' to reverse to '/twitch/', got {reverse('twitch:dashboard')}"
assert reverse("twitch:dashboard") == "/twitch/", msg
def test_debug_tools_not_present_while_testing() -> None:

View file

@ -5,15 +5,19 @@ from django.conf.urls.static import static
from django.urls import include
from django.urls import path
from twitch import views as twitch_views
from core import views as core_views
if TYPE_CHECKING:
from django.urls.resolvers import URLPattern
from django.urls.resolvers import URLResolver
urlpatterns: list[URLPattern | URLResolver] = [
path(route="sitemap.xml", view=twitch_views.sitemap_view, name="sitemap"),
path(route="", view=include("twitch.urls", namespace="twitch")),
path(route="sitemap.xml", view=core_views.sitemap_view, name="sitemap"),
# Core app
path(route="", view=include("core.urls", namespace="core")),
# Twitch app
path(route="twitch/", view=include("twitch.urls", namespace="twitch")),
# Kick app
path(route="kick/", view=include("kick.urls", namespace="kick")),
]