-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathurls.py
More file actions
29 lines (26 loc) · 1.3 KB
/
urls.py
File metadata and controls
29 lines (26 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
from dj_rest_auth.views import LoginView, LogoutView
from dj_rest_auth.registration.views import RegisterView
urlpatterns = [
path("admin/", admin.site.urls),
path('schema/', SpectacularAPIView.as_view(), name='schema'),
path('swagger/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
path('', views.home),
# Authentication URLs
path('api/auth/login/', LoginView.as_view(), name='rest_login'),
path('api/auth/logout/', LogoutView.as_view(), name='rest_logout'),
path('api/auth/register/', RegisterView.as_view(), name='rest_register'),
path('api/auth/', include('dj_rest_auth.urls')),
path('api/auth/registration/', include('dj_rest_auth.registration.urls')),
# Existing URLs
path('auth/', include('django.contrib.auth.urls')),
path('api/', include('posts.urls')),
path('api/books/', include('books.urls')),
path('api/users/', include('users.urls')),
path('accounts/', include('allauth.urls')),
path('api/', include('comments.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)