Развертывание проекта Django с пользовательскими приложениями на heroku: remote: ERROR: /path/to/myapp/django-myapp не является действительным редактируемым требованием

Я использую 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 push 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?

Что вы можете сделать, так это установить отдельные приложения как git-репозитории и разместить их на Github. Если вы все еще хотите иметь более красивые коммиты, вы можете сделать клон репозитория и использовать его вместо этого.

Сопутствующая информация здесь: https://devcenter.heroku.com/articles/python-pip#git-backed-distributions

Вернуться на верх