我正在使用django_smart_select软件包。我在尝试使用链式选择选项的模型中收到以下错误。
AttributeError at /admin/tags/tag/add/
'bool' object has no attribute 'startswith'
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/tags/tag/add/
Django Version: 1.11.4
Exception Type: AttributeError
Exception Value:
'bool' object has no attribute 'startswith'
Error during template rendering
In template C:\Users\gautammandewalker\Envs\django01\lib\site-
packages\django\contrib\admin\templates\admin\base.html, error at line 3
'bool' object has no attribute 'startswith'
1 {% load i18n static %}<!DOCTYPE html>
2 {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi
as LANGUAGE_BIDI %}
3 <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI
%}dir="rtl"{% endif %}>
4 <head>
5 <title>{% block title %}{% endblock %}</title>
6 <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{%
static "admin/css/base.css" %}{% endblock %}" />
7 {% block extrastyle %}{% endblock %}
8 {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{%
block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{%
endif %}
9 {% block extrahead %}{% endblock %}
10 {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{%
endblock %}
11 </head>
12 {% load i18n %}
最佳答案
在settings.py
中使用:
USE_DJANGO_JQUERY = True
去掉
JQUERY_URL = True
关于django - Django管理员: 'bool' object has no attribute 'startswith' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45744315/