boeing1
@boeing1
Начинающий python разработчик

При миграции выводит ошибку синтаксиса, в чем проблема?

605c5620a9cb8294389108.png

python manage.py makemigrations

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/home/boeing/env/myshop/lib/python3.8/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/home/boeing/env/myshop/lib/python3.8/site-packages/django/core/management/__init__.py", line 347, in execute
    django.setup()
  File "/home/boeing/env/myshop/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/boeing/env/myshop/lib/python3.8/site-packages/django/apps/registry.py", line 112, in populate
    app_config.import_models()
  File "/home/boeing/env/myshop/lib/python3.8/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 779, in exec_module
  File "<frozen importlib._bootstrap_external>", line 916, in get_code
  File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/boeing/myshop/shop/models.py", line 27
    class Meta:
    ^
SyntaxError: invalid syntax
(myshop) boeing@boeing-X580VD:~/myshop$ python manage.py makemigrations
Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/home/boeing/env/myshop/lib/python3.8/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/home/boeing/env/myshop/lib/python3.8/site-packages/django/core/management/__init__.py", line 347, in execute
    django.setup()
  File "/home/boeing/env/myshop/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/boeing/env/myshop/lib/python3.8/site-packages/django/apps/registry.py", line 112, in populate
    app_config.import_models()
  File "/home/boeing/env/myshop/lib/python3.8/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 779, in exec_module
  File "<frozen importlib._bootstrap_external>", line 916, in get_code
  File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/boeing/myshop/shop/models.py", line 27
    class Meta(object):
  • Вопрос задан
  • 153 просмотра
Решения вопроса 1
hottabxp
@hottabxp
Сначала мы жили бедно, а потом нас обокрали..
В created = models...в конце нет круглой скобки.

Как по мне, данный вопрос не имеет отношения к Django.
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы