当我从Django 为每个人课程实验室第 5 周 Django 功能和库启动 python3 manage.py makemigration 时,我收到此错误:
(django3) 12:01 ~/django_projects/mysite $ python3 manage.py makemigrations
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
...
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/progroman/django_projects/mysite/mysite/settings.py", line 55
CRISPY_TEMPLATE_PACK = 'bootstrap3'
^
SyntaxError: invalid syntax
settings.py 代码如下。如果我评论 CRISPY_TEMPLATE_PACK = 'bootstrap3' 语法错误指向 TAGGIT_CASE_INSENSITIVE = True
import os
from pathlib import Path
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
APP_NAME = 'ChucksList'
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxx'
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
# Extensions - installed with pip3 / requirements.txt
'django_extensions',
'crispy_forms',
'rest_framework',
'social_django',
'taggit',
'home.apps.HomeConfig',
'crispy.apps.CrispyConfig',
# Sample Applications - don't copy
# When we get to crispy forms :)
CRISPY_TEMPLATE_PACK = 'bootstrap3'
# When we get to tagging
TAGGIT_CASE_INSENSITIVE = True
请告诉我 settings.py 有什么问题