我正在尝试在我的生产站点中设置django工具栏,以便某些ip可以使用它。我遵循了official documentation(安装和快速设置),但是我看不到工具栏。你知道吗
应用程序已安装:
$ yolk -l | grep toolbar
django-debug-toolbar - 0.11.0 - active
我已添加所需的设置:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.sitemaps',
'modeltranslation',
'djangocms_text_ckeditor',
'cms',
'mptt',
'menus',
'south',
'sekizai',
'debug_toolbar',
# more stuff...
)
INTERNAL_IPS = ('---.---.---.---',) # my current ip, taken from the server logs so I'm sure it's correct
STATIC_URL = '/static/'
DEBUG = True
没有错误消息。我也跑了,以防万一。没有成功。你知道吗
有什么建议吗?谢谢:-)
编辑:似乎安装的应用程序的顺序很重要。移动“调试工具栏”django.contrib公司在“modeltranslation”和其他人解决问题之前。你知道吗
我找到原因了。在已安装的应用程序中,“调试工具栏”必须尽快出现。我以前也放过一些其他的应用程序('modeltransation','cms'等等)。把它放在django.contrib公司在其他工作正常之前。你知道吗
你把
INTERNAL_IPS
设成request.META['REMOTE_ADDR']
(第二个答案here)了吗?你知道吗我有一个类似的问题,工具栏不显示,我不知道为什么。但是当我打印
request.META['REMOTE_ADDR']
时,我的IP不是我想象的那样!(因为我使用的是端口转发和虚拟盒)。你知道吗相关问题 更多 >
编程相关推荐