ModuleNotFoundError:没有名为“heroku”的模块

2024-03-29 05:34:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经搜索了很多关于上传我的django项目在heroku,但我不能这样做。请检查以下结构,并让我知道什么是错误的,以及为什么会出现此错误:

File "/app/djangosample1/settings.py", line 17, in import heroku as heroku ModuleNotFoundError: No module named 'heroku'

我的项目结构:

https://github.com/cabudies/djangosample2-master/blob/master/structure.png

程序文件

web: gunicorn djangosample1.wsgi --log-file-

在wsgi.py在

import os from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangosample1.settings")

application = get_wsgi_application() application = DjangoWhiteNoise(application)

而且,每当我运行python时管理.pyrunserver'即使在本地服务器上,我也会收到错误:

SyntaxError: invalid syntax at heroku\helpers.py


Tags: 项目djangofrompyimportmasterwsgiget