您有3个未应用的迁移。在应用app(s)的迁移之前,您的项目可能无法正常运行:news。
运行'python manage.py migrate'
来应用它们。
运行此命令后,它给了我错误。
python manage.py migrate
Traceback (most recent call last): File "manage.py", line 30, in <module>
execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute() File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 308, in execute
settings.INSTALLED_APPS File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name) File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module) File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 110, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name) File "/Users/danazholdykhairova/Desktop/original/bootcamp/config/settings/local.py", line 5, in <module>
from .base import * # noqa File enter code here"/Users/danazholdykhairova/Desktop/original/bootcamp/config/settings/base.py", line 267emphasized text
REDIS_URL = f'{env("REDIS_URL", default="redis://127.0.0.1:6379")}/{0}'
^ SyntaxError: invalid syntax
REDIS_URL变量使用的是f-string - 它只在python 3.6中引入