mhu/4-port-to-django-5.1 Port to recent Django version #18

Merged
sst merged 13 commits from mhu/4-port-to-django-5.1 into develop 2024-11-19 00:03:22 +01:00
2 changed files with 5 additions and 7 deletions
Showing only changes of commit 74e0be71b9 - Show all commits

View File

@ -1,7 +1,6 @@
from django.urls import include, path from django.urls import include, path, re_path
from rest_framework import routers from rest_framework import routers
from .views import * from .views import *
from django.conf.urls import url
router = routers.DefaultRouter() router = routers.DefaultRouter()
router.register(r'users', UserViewSet) router.register(r'users', UserViewSet)
@ -20,6 +19,6 @@ router.register(r'parts/component-param-types', PartsComponentParameterTypeViewS
urlpatterns = [ urlpatterns = [
path('', include(router.urls)), path('', include(router.urls)),
url(r'^token-auth/', ObtainExpiringAuthToken.as_view()), re_path(r'^token-auth/', ObtainExpiringAuthToken.as_view()),
url(r'^token-logout/', TokenLogout.as_view()), re_path(r'^token-logout/', TokenLogout.as_view()),
] ]

View File

@ -14,14 +14,13 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path, include from django.urls import path, include, re_path
from django.conf.urls import url
from django.conf.urls.static import static from django.conf.urls.static import static
from django.conf import settings from django.conf import settings
from parts import views as parts_views from parts import views as parts_views
urlpatterns = [ urlpatterns = [
url(r'^admin/login/', parts_views.login_view), re_path(r'^admin/login/', parts_views.login_view),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('api/v1/', include('api.urls'), name='api-root'), path('api/v1/', include('api.urls'), name='api-root'),
path('', include('parts.urls')), path('', include('parts.urls')),