buffmomo

urls.py

Feb 19th, 2024
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.41 KB | Source Code | 0 0
  1. """
  2. URL configuration for core project.
  3.  
  4. The `urlpatterns` list routes URLs to views. For more information please see:
  5.    https://docs.djangoproject.com/en/4.2/topics/http/urls/
  6. Examples:
  7. Function views
  8.    1. Add an import:  from my_app import views
  9.    2. Add a URL to urlpatterns:  path('', views.home, name='home')
  10. Class-based views
  11.    1. Add an import:  from other_app.views import Home
  12.    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
  13. Including another URLconf
  14.    1. Import the include() function: from django.urls import include, path
  15.    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
  16. """
  17.  
  18. from django.conf import settings
  19. from django.conf.urls.static import static
  20. from django.urls import path, include
  21. from django.contrib import admin
  22.  
  23. from apps.container.views import dashboard, redirect_to_dashboard
  24.  
  25. urlpatterns = [
  26.     path("admin/", admin.site.urls),
  27.     path("accounts/", include("django.contrib.auth.urls")),
  28.     path("container/", include("apps.container.urls")),
  29.     path("dashboard", dashboard, name="dashboard"),
  30.     path("", redirect_to_dashboard, name="redirect-to-dashboard"),
  31.     # path("admin/linkcheck/", include("linkcheck.urls")),
  32. ]
  33.  
  34. if settings.DEBUG:
  35.     urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  36.  
  37.  
  38. DEBUG = [
  39.     path("__debug__/", include("debug_toolbar.urls")),
  40. ]
  41.  
  42.  
  43. urlpatterns += DEBUG
  44.  
Advertisement
Add Comment
Please, Sign In to add comment