我正在使用Django 3.2
我已经写了一些独立的应用程序,我正在我的项目中使用。在我的需求文件中,我将它们包含在requirements.txt文件的底部,如下所示:
requirements.txt
asgiref==3.5.0
Babel==2.9.1
certifi==2021.10.8
charset-normalizer==2.0.12
coverage==6.4.1
dj-database-url==0.5.0
Django==3.2
django-appconf==1.0.5
django-crispy-forms==1.14.0
django-js-asset==2.0.0
gunicorn==20.1.0
idna==3.3
psycopg2-binary==2.9.3
python-decouple==3.6
pytz==2022.1
requests==2.27.1
six==1.16.0
sqlparse==0.4.2
urllib3==1.26.9
webencodings==0.5.1
whitenoise==6.0.0
-e /path/to/django-apps/moderation/django-moderation
-e /path/to/django-apps/social/django-social
-e /path/to/django-apps/user/django-userprofile
-e /path/to/django-apps/event/django-events
-e /path/to/django-apps/contactus/django-contactus在我的本地机器上,我输入:pip install -r requirements.txt并正确安装了所有东西。
但是,当我试图通过键入以下命令部署到heroku时:
git推heroku main
我收到以下错误消息:
remote: -----> Installing requirements with pip
remote: ERROR: /path/to/django-apps/moderation/django-moderation is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...如何解决这个问题,以便将本地更改推送给heroku?
发布于 2022-06-24 07:29:20
您应该能够做的是将独立的应用程序安装为git存储库,并将它们保存在GitHub上。如果您仍然希望拥有更好的提交,则可以复制存储库并使用它。
相关信息可在以下链接中找到:https://devcenter.heroku.com/articles/python-pip#git-backed-distributions
https://stackoverflow.com/questions/72630879
复制相似问题