При развертывании Django блога на героку показываются ошибки - PullRequest
0 голосов
/ 02 апреля 2020

Когда я развертываю приложение в heroku, покажите мне эту ошибку

remote: ERROR: Could not find a version that satisfies the requirement apturl==0.5.2 (from -r /tmp/build_16067d5dbf345d8d906970e4d4f44d30/requirements.txt

Я искал по inte rnet, чтобы найти решение этой проблемы, но не смог найти его.

Итак, я покажу вам, какие шаги я предпринял для развертывания приложения в heroku, которое я набрал в терминале

heroku login    
pip3 freeze
pip3 freeze > requirements.txt

Затем для установки типа gunicorn в терминале

pip3 install gunicorn

Затем создайте файл в root в директории пишут имя Procifle, в котором я пишу

web: gunicorn django_project.wsgi

Тогда мое имя в блоге heroku

heroku git:remote -a naqviblog

Я также покажу вам свои файлы require.txt

apturl==0.5.2
asgiref==3.2.3
asn1crypto==0.24.0
blinker==1.4
boto3==1.9.96
botocore==1.12.96
Brlapi==0.6.7
certifi==2018.8.24
chardet==3.0.4
command-not-found==0.3
cryptography==2.3
cupshelpers==1.0
defer==1.0.6
distro==1.3.0
distro-info===0.21ubuntu2
dj-database-url==0.5.0
Django==3.0.4
django-crispy-forms==1.9.0
django-heroku==0.3.1
django-storages==1.7.1
docutils==0.14
entrypoints==0.3
f.lux-indicator-applet==1.1.11rc0
galternatives==1.0.3
gunicorn==20.0.4
httplib2==0.11.3
idna==2.6
jmespath==0.9.3
keyring==17.1.1
keyrings.alt==3.1.1
language-selector==0.1
launchpadlib==1.10.6
lazr.restfulclient==0.14.2
lazr.uri==1.0.3
lightdm-gtk-greeter-settings==1.2.2
louis==3.8.0
macaroonbakery==1.2.1
Mako==1.0.7
MarkupSafe==1.1.0
netifaces==0.10.4
oauth==1.0.1
oauthlib==2.1.0
olefile==0.46
pbr==5.4.4
pexpect==4.6.0
Pillow==5.4.1
protobuf==3.6.1
psycopg2==2.7.7
pycairo==1.16.2
pycrypto==2.6.1
pycups==1.9.73
PyGObject==3.32.0
PyJWT==1.7.0
pymacaroons==0.13.0
PyNaCl==1.3.0
pyOpenSSL==19.0.0
pyRFC3339==1.1
python-apt===1.8.5-ubuntu0.3
python-dateutil==2.7.3
python-debian==0.1.34
python-decouple==3.3
pytz==2018.9
pyxattr==0.6.1
pyxdg==0.25
PyYAML==3.13
reportlab==3.5.18
requests==2.21.0
requests-unixsocket==0.1.5
s3transfer==0.2.0
SecretStorage==2.3.1
simplejson==3.16.0
six==1.12.0
sqlparse==0.3.1
system-service==0.3
systemd-python==234
testresources==2.0.1
ubuntu-advantage-tools==19.2
ubuntu-drivers-common==0.0.0
ufw==0.36
unattended-upgrades==0.1
urllib3==1.24.1
usb-creator==0.3.3
virtualenv==15.1.0
wadllib==1.3.3
whitenoise==4.1.2
xkit==0.0.0
youtube-dl==2019.1.17
zope.interface==4.3.2

Затем введите в терминал

git add .
git commit -m "commit changes"

наконец введите

git push heroku master

, затем показал мне эту ошибку

Enumerating objects: 77, done.
Counting objects: 100% (77/77), done.
Delta compression using up to 4 threads
Compressing objects: 100% (60/60), done.
Writing objects: 100% (67/67), 3.72 MiB | 421.00 KiB/s, done.
Total 67 (delta 21), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Clearing cached dependencies
remote: -----> Installing python-3.6.10
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: Sqlite3 successfully installed.
remote: -----> Installing requirements with pip
remote:        ERROR: Could not find a version that satisfies the requirement apturl==0.5.2 (from -r /tmp/build_d533b9574fcab74e6906cdc8732269b2/requirements.txt (line 1)) (from versions: none)
remote:        ERROR: No matching distribution found for apturl==0.5.2 (from -r /tmp/build_d533b9574fcab74e6906cdc8732269b2/requirements.txt (line 1))
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to naqviblog.
remote: 
To https://git.heroku.com/naqviblog.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/naqviblog.git'

, когда открою эту ссылку https://git.heroku.com/naqviblog.git, затем покажите мне на браузер

Method Not Allowed

1 Ответ

0 голосов
/ 02 апреля 2020
  • Это много пакетов. Вы уверены, что ваш проект требует их всех?
  • Вы добавили тег python -3.7, но Heroku говорит, что он использует python 3.6. Убедитесь, что среда разработки и производственная среда совпадают.
  • apturl не существует в PyPI https://pypi.org/. Когда вы запускаете python -m pip install packagename, вы ищете его в PyPI. Там его нет. Возможно, вы установили его через apt, setup.py, wheels, et c.
...