编辑urls.py文件如下:
from django.urls import path, include
from django.views.generic import RedirectView
urlpatterns = [
path('polls/', include('polls.urls')),
path('', RedirectView.as_view(url='polls/')),
]
即表示将xxx.com跳转到xxx.com/polls/。
作者:独苏揽月
来源:CSDN
原文:https://blog.csdn.net/blueblood1/article/details/82560386
版权声明:本文为博主原创文章,转载请附上博文链接!