本文介绍了在使用Python Django时遇到的SyntaxError:Generator expression must be parenthesized错误的原因和解决方法。该错误可能是由于Django 1.11与Python 3.7版本不兼容导致。解决方案包括删除引发错误的逗号或升级到Django 2.0及以上版本。
摘要由CSDN通过智能技术生成
Django 报错 SyntaxError: Generator expression must be parenthesized
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "D:\lijingwen\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 364, in execute_from_command_line
utility.execute()
File "D:\lijingwen\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 338, in execute
django.setup()
File "D:\lijingwen\Python\Python37\lib\site-packages\django\__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "D:\lijingwen\Python\Python37\lib\site-packages\django\apps\registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "D:\lijingwen\Python\Python37\lib\site-packages\django\apps\config.py", line 94, in creat