django - Django管理员: 'bool' object has no attribute 'startswith'

标签 django

我正在使用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/

相关文章:

django - 使用 python 3 用 django 创建 PDF

Django admin list_display_links 到外键

python - Django 高级过滤器在 django-material admin 主题中不起作用

django - celery 的清理taskmeta表

Python:如何解决 python setup.py egg_info failed with error code 1

python - 使用第三方电子邮件系统进行 Django 密码重置

python - 从 Django 模板访问 JSON 嵌套值(数组)

django - 如何在某些模型管理员中禁用 mptt 的 TreeForeignKey 字段的 Select 小部件中的某些选项?

Python 2.6.2,Django 1.0.3,Windows XP,找不到页面 :/

python - 使用 django-adaptors 导入 csv 文件