首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用自定义应用程序将Django项目部署到heroku: remote: ERROR: /path/ to /myapp/django-myapp不是有效的可编辑要求

使用自定义应用程序将Django项目部署到heroku: remote: ERROR: /path/ to /myapp/django-myapp不是有效的可编辑要求
EN

Stack Overflow用户
提问于 2022-06-15 11:51:21
回答 1查看 122关注 0票数 -1

我正在使用Django 3.2

我已经写了一些独立的应用程序,我正在我的项目中使用。在我的需求文件中,我将它们包含在requirements.txt文件的底部,如下所示:

requirements.txt

代码语言:javascript
复制
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

我收到以下错误消息:

代码语言:javascript
复制
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?

EN

回答 1

Stack Overflow用户

发布于 2022-06-24 07:29:20

您应该能够做的是将独立的应用程序安装为git存储库,并将它们保存在GitHub上。如果您仍然希望拥有更好的提交,则可以复制存储库并使用它。

相关信息可在以下链接中找到:https://devcenter.heroku.com/articles/python-pip#git-backed-distributions

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72630879

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档