Python 什么';Django contrib.auth复制URL路由的原因是什么?

Python 什么';Django contrib.auth复制URL路由的原因是什么?,python,django,django-authentication,Python,Django,Django Authentication,Django新手在这里-在contrib.auth模块周围闲逛,注意到有几个地方定义了额外的路由: 从/django/contrib/auth/url.py # The views used below are normally mapped in django.contrib.admin.urls.py # This URLs file is used to provide a reliable view deployment for test purposes. # It is also p

Django新手在这里-在contrib.auth模块周围闲逛,注意到有几个地方定义了额外的路由:

/django/contrib/auth/url.py

# The views used below are normally mapped in django.contrib.admin.urls.py
# This URLs file is used to provide a reliable view deployment for test purposes.
# It is also provided as a convenience to those who want to deploy these URLs
# elsewhere.

“用于测试目的的可靠视图部署”是什么意思?在此上下文中,“在别处部署这些url”是什么意思?

在Django的测试中使用url模式,例如和。它是可靠的,因为它在任何地方都包含映射到相同URL的相同视图集

您还可以在自己的项目中使用这些URL(即,在其他地方部署这些URL):

有关更多信息,请参阅。但是,如果您想要更多的定制(例如,使用url
/signin/
而不是
/login/
),那么您需要向url.py添加单独的url模式,而不是包含整个
django.contrib.auth.url

urlpatterns = [
    ...
    url('^', include('django.contrib.auth.urls'))
]