Django Deprecation Warning or ImproperlyConfigured error - Passing a 3-tuple to django.conf.urls.include() is not supported

前端 未结 2 1441
心在旅途
心在旅途 2020-12-14 14:08

I have a deprecation warning in Django 1.11:

RemovedInDjango20Warning: Passing a 3-tuple to django.conf.urls.include() is deprecated. Pass a 2-tuple containi         


        
2条回答
  •  生来不讨喜
    2020-12-14 14:34

    As of Django 1.9, the old way of including the admin urls is deprecated. You should pass admin.site.urls directly to url(), without the call to include():

    from django.contrib import admin
    
    urlpatterns = [
        url(r'^admin/', admin.site.urls),
        ...
    ]
    

提交回复
热议问题