项目后端 - 路由

主路由

luffyapi/urls.py
from django.contrib import admin
from django.urls import path, re_path, include
from django.views.static import serve
from django.conf import settings
urlpatterns = [
    path('admin/', admin.site.urls),

    path('user/', include('user.urls')),

    re_path('^media/(?P<path>.*)', serve, {'document_root': settings.MEDIA_ROOT})
]

子路由

user/urls.py
from django.urls import path, re_path
urlpatterns = [

]

 

posted @ 2019-10-26 11:42  waller  阅读(153)  评论(0编辑  收藏  举报