I ran into an error when running the command: heroku run python manage.py migrate
. When I run it it raises en error: ModuleNotFoundError: No module named 'django'.
My app runs fine locally. Django is installed.
在运行命令时,我遇到了一个错误:Heroku run pythonManage.py Migrate。当我运行它时,它会出现错误:ModuleNotFoundError:没有名为‘Django’的模块。我的应用在本地运行得很好。Django已安装。
I tried to search the internet but I see the answers for the errors with the module "django-heroku", not just "django". If anyone has any suggestions, I would be grateful!
我试着在互联网上搜索,但我找到了错误的答案,模块是“Django-Heroku”,而不仅仅是“Django”。如果任何人有任何建议,我将不胜感激!
更多回答
What you have installed locally is irrelevant. Have you declared the dependency? Are you using a requirements.txt
file or a Pipfile
? Whichever, please edit it into your question as a code block.
您在本地安装的内容无关紧要。您声明依赖关系了吗?您使用的是Requirements.txt文件还是管道文件?无论哪一种,请将其作为代码块编辑到您的问题中。
优秀答案推荐
我是一名优秀的程序员,十分优秀!