1
resposta

[Dúvida] Erro ao fazer a migração

Olá boa noite. Estou tentando fazer a migração no heroku mas mostra o seguinte erro:

heroku run python manage.py migrate
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/__init__.py", line 420, in execute
    django.setup()
  File "/app/.heroku/python/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)  File "/app/.heroku/python/lib/python3.10/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/app/.heroku/python/lib/python3.10/site-packages/django/apps/config.py", line 193, in create
    import_module(entry)
  File "/app/.heroku/python/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rest_framework'

Como proceder?

1 resposta

Olá João Victor,

Verifica no servidor se a biblioteca 'rest_framework' foi instalada. Por garantia executa novamente:

sudo pip install rest_framework