Cache images instead of serve from Twitch
This commit is contained in:
parent
d434eac74a
commit
b97118cffd
16 changed files with 340 additions and 30 deletions
|
|
@ -3,13 +3,14 @@ from __future__ import annotations
|
|||
from typing import TYPE_CHECKING
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from django.urls.resolvers import URLResolver
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
|
||||
urlpatterns: list[URLResolver] = [
|
||||
urlpatterns: list[URLResolver] | list[URLPattern | URLResolver] = [ # type: ignore[assignment]
|
||||
path(route="admin/", view=admin.site.urls),
|
||||
path(route="accounts/", view=include("accounts.urls", namespace="accounts")),
|
||||
path(route="", view=include("twitch.urls", namespace="twitch")),
|
||||
|
|
@ -24,3 +25,7 @@ if not settings.TESTING:
|
|||
*debug_toolbar_urls(),
|
||||
path("__reload__/", include("django_browser_reload.urls")),
|
||||
]
|
||||
|
||||
# Serve media in development
|
||||
if settings.DEBUG:
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue