Add initial Django project
This commit is contained in:
parent
94aae4653c
commit
fa6af127c1
15 changed files with 1103 additions and 4 deletions
32
config/urls.py
Normal file
32
config/urls.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
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
|
||||
from django.urls import path
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from django.urls import URLPattern
|
||||
from django.urls.resolvers import URLResolver
|
||||
|
||||
urlpatterns: list[URLPattern | URLResolver] = [
|
||||
path(route="admin/", view=admin.site.urls),
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
# Serve static files during development
|
||||
urlpatterns += static(
|
||||
prefix=settings.STATIC_URL,
|
||||
document_root=settings.STATIC_ROOT,
|
||||
)
|
||||
urlpatterns += [
|
||||
path(
|
||||
route="__debug__/",
|
||||
view=include(arg="debug_toolbar.urls"),
|
||||
),
|
||||
path(
|
||||
route="__reload__/",
|
||||
view=include(arg="django_browser_reload.urls"),
|
||||
),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue