Initial commit: React + Django 城市手册项目
- Django 4.2 + DRF + JWT + GraphQL - React 18 + MobX + styled-components - PostgreSQL 数据库 - Docker + Docker Compose + Nginx - 完整的功能模块(用户、版块、文章、服务、交互、版主管理) - 完整的文档(需求、部署、测试)
This commit is contained in:
37
backend/config/urls.py
Normal file
37
backend/config/urls.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""
|
||||
URL configuration for the project.
|
||||
"""
|
||||
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from rest_framework_simplejwt.views import (
|
||||
TokenObtainPairView,
|
||||
TokenRefreshView,
|
||||
)
|
||||
from apps.api.views import CustomTokenObtainPairView
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
|
||||
# Authentication
|
||||
path('api/auth/login/', CustomTokenObtainPairView.as_view(), name='token_obtain_pair'),
|
||||
path('api/auth/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
|
||||
|
||||
# API endpoints
|
||||
path('api/', include('apps.users.urls')),
|
||||
path('api/', include('apps.regions.urls')),
|
||||
path('api/', include('apps.articles.urls')),
|
||||
path('api/', include('apps.featured_services.urls')),
|
||||
path('api/', include('apps.moderation.urls')),
|
||||
path('api/', include('apps.interactions.urls')),
|
||||
path('api/', include('apps.api.urls')),
|
||||
|
||||
# GraphQL
|
||||
path('graphql/', include('apps.api.graphql_urls')),
|
||||
]
|
||||
|
||||
# Serve media files in development
|
||||
if settings.DEBUG:
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
Reference in New Issue
Block a user