【问题标题】:I get an error when I try to deploy to Heroku with simpleJWT version 4.6.0当我尝试使用 simpleJWT 版本 4.6.0 部署到 Heroku 时出现错误
【发布时间】:2023-03-22 17:31:01
【问题描述】:

当我在 Django 中安装 djangorestframework-simplejwt 4.6.0 并尝试将其部署到 Heroku 时,我收到以下错误:

remote:          Downloading djangorestframework-3.12.2-py3-none-any.whl (957 kB)
remote:        ERROR: Could not find a version that satisfies the requirement djangorestframework-simplejwt==4.6.0 (from -r /tmp/build_5927f5b0/requirements.txt (line 19)) (from versions: 1.0, 1.1, 1.2, 1.2.1, 1.3, 1.4, 1.5.1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.1, 3.0, 3.1, 3.2, 3.2.1, 3.2.2, 3.2.3, 3.3, 4.0.0, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.1.5, 4.2.0, 4.3.0, 4.4.0)
remote:        ERROR: No matching distribution found for djangorestframework-simplejwt==4.6.0 (from -r /tmp/build_5927f5b0/requirements.txt (line 19))

我尝试安装和部署 4.4.0 以查看是否可以找到 4.6.0,并且我能够部署它,但是当我尝试使用 python manage.py runserver 启动和访问它时,'str' object has no attribute 'decode'

为什么会这样?如果您能告诉我如何喂它们,我将不胜感激。

【问题讨论】:

  • 卸载PyJWT==2.0.1并安装PyJWT==1.7.1

标签: python django django-rest-framework-simplejwt pyjwt


【解决方案1】:

将 heroku 中的 python 运行时更改为 3.7 或更高版本。我有一个类似的问题,所以在你的 django 项目的根文件夹中创建一个 runtime.txt 文件,并指定你想要的 python 版本,例如它的 python-3.8.11。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多