django1.11 启动错误:Generator expression must be parenthesized

django1.11 启动错误:Generator expression must be parenthesized

原文出处:https://www.cnblogs.com/yanlin-10/p/9714793.html

错误信息:

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10f03b8c8>
Traceback (most recent call last):
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 227, in wrapper
    fn(*args, **kwargs)
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
    autoreload.raise_last_exception()
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 250, in raise_last_exception
    six.reraise(*_exception)
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 227, in wrapper
    fn(*args, **kwargs)
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/apps/config.py", line 94, in create
    module = import_module(entry)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/contrib/admin/__init__.py", line 4, in <module>
    from django.contrib.admin.filters import (
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/contrib/admin/filters.py", line 10, in <module>
    from django.contrib.admin.options import IncorrectLookupParameters
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/contrib/admin/options.py", line 12, in <module>
    from django.contrib.admin import helpers, widgets
  File "/Users/yanlin/PycharmProjects/djangoPro/my_django/venv/lib/python3.7/site-packages/django/contrib/admin/widgets.py", line 151
    ‘%s=%s‘ % (k, v) for k, v in params.items(),
    ^
SyntaxError: Generator expression must be parenthesized

解决方法:

找到出错语句:

去掉末尾那个逗号即可。

原文地址:https://www.cnblogs.com/hellozizi/p/11525362.html

时间: 2024-10-14 06:15:31

django1.11 启动错误:Generator expression must be parenthesized的相关文章

VScode 搭建 django 开发环境(Win Python3.71 django1.11.11)

全新Win10下安装开发环境记录 安装VScode 安装Git 安装Python3.71 VScode安装好相关插件 新建好文件夹用 VScode 打开 code-终端-新建终端 要创建虚拟环境,请使用以下命令,其中“env”是环境文件夹的名称: 1 py -3 -m venv env 进入虚拟环境文件夹 cd env 安装指定版本DJango pip3 install django==1.11.11 安装依赖 pip3 install pylint pylint_django 输出已安装了 D

centos启动错误:Inodes that were part of a corrupted orphan linked list found.

centos启动时,提示错误: 1 /dev/mapper/VolGroup-lv_root contains a file system with errors,check forced. 2 /dev/mapper/VolGroup-lv_root: 3 Inodes that were part of a corrupted orphan linked list found. 4 /dev/mapper/VolGroup-lv_root:unexpected inconsistency:r

Django1.11搭建一个简易上传显示图片的后台

项目展示需要,之前没研究过Django,网上查资料快速做了一个后台,写下了防止自己忘了. p { margin-bottom: 0.1in; line-height: 120% } a:link { } 1. 安装Django: pip install Django 2. 测试Django: python >> import django >>django.VERSION 显示版本为(1, 11, 5, 'final', 0),刚接触,github也没找到能运行起来的. 3. 运行

关于Eric 6的后端调试器无法启动错误 [The Debugger backend could not be started]

声明: 1)本文由我bitpeach原创撰写.本篇如有转载,请注明来源. 2)本篇主要谈Eric6的一个怪异错误.因为篇幅不长,只是一个短记,以备档查阅. 1.1 软件环境 (1)Eirc6 ,版本号:6.0.5 (2)PyQt4.11.3 (3)Python2.7.3 (4)Windows7 1.2 错误类型 (1)后端调试器无法启动错误 (2)英文描述是:The Debugger backend could not be started 1.3 错误调研 (1)百度后,类似结果基本没有,所以

Windows下Python3.6.2+Django-1.11.5+httpd-2.4.27-win64-VC14部署网站

最近项目组正在上python+django.现在将部署过程总结下,相关文件也备份下,面得每次都要弄半天.网上很多不靠谱的做法,让我反复试错,浪费不少时间. 原材料: Python3.6.2 httpd-2.4.27-win64-VC14 mod_wsgi-4.5.17+ap24vc14-cp36-cp36m-win_amd64.whl Django-1.11.5 说明: 由于Python2.7未来会停止更新,公司就采用最新版算了 Apache不能编译成功,干脆就下了,现在采用的2.4 VC14版

详解Python中的生成器表达式(generator expression)

介绍 1.生成器表达式(generator expression)也叫生成器推导式或生成器解析式,用法与列表推导式非常相似,在形式上生成器推导式使用圆括号(parentheses)作为定界符,而不是列表推导式所使用的方括号(square brackets). 2.与列表推导式最大的不同是,生成器推导式的结果是一个生成器对象.生成器对象类似于迭代器对象,具有惰性求值的特点,只在需要时生成新元素,比列表推导式具有更高的效率,空间占用非常少,尤其适合大数据处理的场合. 3.使用生成器对象的元素时,可以

win10 64位 python3.6 django1.11 MysqlDB No module named &#39;MySQLdb&#39; 安装MysqlDB报错 Microsoft Visual C++ 14.0 is required

在python3.6中操作数据库,再按python2.7安装MySQLdb进行数据库连接已经不可用了,我使用的是另外一个方法:PyMySQL,安装好之后还是不能直接连接MySQL的,启动项目后报No module named 'MySQLdb' 解决方案: 在项目的__init__()文件中添加如下代码: import pymysql pymysql.install_as_MySQLdb() 这时再次启动项目正常 win10 64位 python3.6 django1.11 MysqlDB No

django1.11如何用post方法提交表单

django为了帮助应对跨站脚本攻击,在以POST方法提交表单时,要求将其内置的CSRF中间件添加到setting.py的中间件设置中(django.middleware.csrf.CsrfViewMiddleware,默认已添加),并且在<form>标签后添加{% csrf_token %},即表单元素变为: <form action="" method="post">{% csrf_token %} 同时,表单提交对应的视图函数也要调用R

oracle 监听启动错误

oracle 监听启动错误 | 进击的大黄 盒子 盒子 博客 分类 标签 友链 关于 RSS 搜索 上午启动应用连接测试数据库的时候一直显示连接已满,然后上网查需要修改数据库最大连接数SQL> alter system set processes=1000 scope=spfile;然后重启数据库,但是 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ? /Users/huangrupeng >ssh [email pro