Django Web App Heroku Deployement : 找不到解耦==0.0.7的匹配分布



我正在Heroku上部署一个用Django制作的Web应用程序。 我正在遵循一个教程,其中导师在没有用户的任何 CSS/图像输入的情况下制作了一个 w/s。但是我的应用程序有很多样式和个人资料图片等,需要在模型中使用ImageField。

IMP -> 我为 Django 2.2 制作了项目,但 django 3 启动了,所以我正在使用它。

请帮帮我...

我已经完成了以下步骤:

  1. 已安装的蟒蛇
  2. 制作虚拟环境并激活它。
  3. 安装的点
  4. 已安装的依赖项
  5. 点冻结>要求.txt
  6. git add . & git push -am "Text">
  7. git push heroku master

我的要求.txt :

asgiref==3.2.3
certifi==2019.11.28
cffi==1.13.2
decouple==0.0.7
dj-database-url==0.5.0
Django==3.0.2
django-appconf==1.0.3
django-bootstrap3==12.0.3
django-heroku==0.3.1
django-mediumeditor==1.0.0
gunicorn==20.0.4
misaka==2.1.1
psycopg2==2.8.4
pycparser==2.19
python-decouple==3.3
pytz==2019.3
six==1.14.0
sqlparse==0.3.0
whitenoise==5.0.1

我的错误:

Enumerating objects: 18, done.
Counting objects: 100% (18/18), done.
Delta compression using up to 8 threads
Compressing objects: 100% (16/16), done.
Writing objects: 100% (16/16), 1.96 KiB | 1.96 MiB/s, done.
Total 16 (delta 9), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Need to update SQLite3, clearing cache
remote: -----> Installing python-3.6.10
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: Sqlite3 successfully installed.
remote: -----> Installing requirements with pip
remote:        Collecting asgiref==3.2.3 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 1))
remote:          Downloading https://files.pythonhosted.org/packages/a5/cb/5a235b605a9753ebcb2730c75e610fb51c8cab3f01230080a8229fa36adb/asgiref-3.2.3-py2.py3-none-any.whl
remote:        Collecting certifi==2019.11.28 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 2))
remote:          Downloading https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl (156kB)
remote:        Collecting cffi==1.13.2 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 3))
remote:          Downloading https://files.pythonhosted.org/packages/49/72/0d42f94fe94afa8030350c26e9d787219f3f008ec9bf6b86c66532b29236/cffi-1.13.2-cp36-cp36m-manylinux1_x86_64.whl (397kB)
remote:        Collecting decouple==0.0.7 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 4))
remote:          Could not find a version that satisfies the requirement decouple==0.0.7 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 4)) (from versions: )
remote:        No matching distribution found for decouple==0.0.7 (from -r /tmp/build_4f35d204f58c179bdbd37fc71a4afa61/requirements.txt (line 4))
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to *******.
remote: 
To https://git.heroku.com/******.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/******.git'

您需要在项目的根目录下添加一个运行时.txt文件,其中包含以下内容: 蟒蛇-3.7.2

然后再次推动。

你使用的是Python 3.6,decouple需要Python 3.7+。

最新更新