django-debug-toolbar安装过程中的error

django-debug-toolbar安装过程中的error

1、djdt’ is not a registered namespace

解决:在url中添加如下代码
if settings.DEBUG:
    import debug_toolbar
    urlpatterns = [
        url(r'__debug__/',include(debug_toolbar.urls)),
    ] + urlpatterns

2、name 'include' is not defined

解决:在urls中添加如下代码
from django.conf.urls import include

3、name 'settings' is not defined

解决:在urls中添加如下代码
from django.conf import settings
上一篇:day62 django入门(3)


下一篇:第三章 九析带你轻松完爆 etcd - 集群初始化