day67 django debug toolbar安装

  1. 安装:python:pip install django-debug-toolbar
  2. setting里操作这些:
  • INSTALLED_APPS里加上'debug_toolbar'
  • 加上INTERNAL_IPS = ['127.0.0.1',]
  • MIDDLEWARE 里加上'debug_toolbar.middleware.DebugToolbarMiddleware',
  • 加上STATICFILES_DIRS = ( os.path.join(BASE_DIR,'static'), )

urls.py里:

from django.conf import settings,include
if settings.DEBUG:
    import debug_toolbar
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ]

 

你可能感兴趣的:(学习笔记合集)