当我想使用部署代码到Heroku时
git push heroku master
我有ImportError:Couldn't import Django
。
因此,我尝试python manage.py runserver
来看看发生了什么,并在终端中显示了这一点。
Full description of ImportError:Couldn't import Django。
在我完成将代码部署到Heroku的所有过程之前,python manage.py runserver
运作良好(系统为我提供了打开我的网页的链接)。
这是我的要求。txt requirements.txt
答案 0 :(得分:0)
通常,当您将Python应用程序部署到Heroku时,必须具有requirements.txt文件。我遇到了同样的错误,当我将所有依赖项添加到requirements.txt文件时,一切都正常了。最好的方法是在虚拟环境中运行
styled-components