Files
MES_Core/core/urls.py
ackFromRedmi 6013d5854b
All checks were successful
Deploy MES Core / deploy (push) Successful in 10s
Доработали фильт в реестре заданий
2026-03-29 20:29:05 +03:00

37 lines
1.7 KiB
Python

"""
URL configuration for core project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/6.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.views.generic import RedirectView
from django.templatetags.static import static as static_url
from django.conf.urls.static import static # <--- Добавьте эту строку
from core import settings
urlpatterns = [
path('favicon.ico', RedirectView.as_view(url=static_url('favicon.svg'), permanent=True)),
path('admin/', admin.site.urls),
# Добавь эту строку, она подключит login, logout и прочие стандартные пути
path('accounts/', include('django.contrib.auth.urls')),
# Подключаем урлы нашего приложения
path('', include('shiftflow.urls')),
]
# Вместо if settings.DEBUG: не забываем from django.conf.urls.static import static # <--- Добавьте эту строку
if settings.ENV_TYPE in ['local', 'dev']:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)