feat: wpr注册到路由
This commit is contained in:
parent
86007d0ad4
commit
2790bddefa
|
@ -0,0 +1,14 @@
|
|||
from django.urls import path, include
|
||||
from rest_framework.routers import DefaultRouter
|
||||
|
||||
from apps.wpmw.views import WprViewSet
|
||||
|
||||
|
||||
API_BASE_URL = 'api/wpmw/'
|
||||
HTML_BASE_URL = 'wpmw/'
|
||||
|
||||
router = DefaultRouter()
|
||||
router.register('wpr', WprViewSet, basename='wpr')
|
||||
urlpatterns = [
|
||||
path(API_BASE_URL, include(router.urls)),
|
||||
]
|
|
@ -7,6 +7,10 @@ from apps.wpmw.serializers import WprSerializer
|
|||
|
||||
|
||||
class WprViewSet(CustomListModelMixin, CustomGenericViewSet):
|
||||
"""动态产品
|
||||
|
||||
动态产品
|
||||
"""
|
||||
perms_map = {"get": "*"}
|
||||
queryset = Wpr.objects.all()
|
||||
serializer_class = WprSerializer
|
||||
|
|
|
@ -70,6 +70,7 @@ urlpatterns = [
|
|||
path('', include('apps.dpm.urls')),
|
||||
path('', include('apps.cm.urls')),
|
||||
path('', include('apps.cms.urls')),
|
||||
path('', include('apps.wpmw.urls')),
|
||||
|
||||
# 前端页面入口
|
||||
path('', TemplateView.as_view(template_name="index.html")),
|
||||
|
|
Loading…
Reference in New Issue