标签:clu too lib tps 中间件 rmi boot settings deb
```python
#先安装
pip install django-debug-toolbar
#在settings.py里面设置
#在本机调试就写本机的IP地址
INTERNAL_IPS = [‘127.0.0.1‘, ]
#要引入jquery,自己在bootcdn上面选一个合适的
DEBUG_TOOLBAR_CONFIG = {
"JQUERY_URL": ‘https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js‘,
}
#注册app
INSTALLED_APPS = [‘debug_toolbar‘,
]
#注册中间件
MIDDLEWARE = [
‘debug_toolbar.middleware.DebugToolbarMiddleware‘,
]
#最后在项目根目录的urls.py里面配置
from django.conf import settings
if settings.DEBUG:
import debug_toolbar
urlpatterns = [
url(r‘^__debug__/‘, include(debug_toolbar.urls)),
] + urlpatterns
标签:clu too lib tps 中间件 rmi boot settings deb
原文地址:https://www.cnblogs.com/newcomer2012/p/14531436.html