python - ModuleNotFoundError:在heroku上运行时,django中没有名为'name_of_project'的模块
问题描述
我第一次尝试在 heroku 上托管我的 django 应用程序,并且我能够成功部署它,但我遇到了一个应用程序错误,正在向我展示我的 heroku 网页的这张图片,当我使用它查看日志时,heroku logs --tail
它向我展示了这个错误日志详细信息。
在其中显示 ModuleNotFoundError: No module named 'twitter_project' 这里 'twitter_project' 是我的项目的名称。我做了pip install django-heroku
并在顶部pip install gunicorn
导入并在末尾添加,添加了一个包含此内容的 Procfile,并且也是完整的,并且已经添加了,我不知道我做错了什么。如果我的静态文件有问题,我不会。import django_heroku
settings.py
django_heroku.settings(locals())
settings.py
web: gunicorn twitter_project.wsgi
requirements.txt
django-heroku==0.3.1
gunicorn==20.0.4
这是我的项目的结构
C:.
| as.txt
| out.doc
|
+---twitter_project
| | db.sqlite3
| | manage.py
| | Procfile
| | requirements.txt
| |
| +---home
| | | admin.py
| | | apps.py
| | | models.py
| | | tests.py
| | | urls.py
| | | views.py
| | | __init__.py
| | |
| | +---dash_apps
| | | \---finished_apps
| | | | simpleexample.py
| | | |
| | | \---__pycache__
| | | simpleexample.cpython-37.pyc
| | |
| | +---migrations
| | | | __init__.py
| | | |
| | | \---__pycache__
| | | __init__.cpython-37.pyc
| | |
| | +---static
| | | \---home
| | | \---img
| | | | negative_dettol.png
| | | | positive_dettol.png
| | | |
| | | \---bg
| | | 215771.jpg
| | | q1w2e3.jpg
| | | qwer.jpg
| | | qwer1.jpg
| | | twitter-bird.jpg
| | |
| | +---templates
| | | \---home
| | | home.html
| | | welcome.html
| | |
| | \---__pycache__
| | admin.cpython-37.pyc
| | apps.cpython-37.pyc
| | models.cpython-37.pyc
| | urls.cpython-37.pyc
| | views.cpython-37.pyc
| | __init__.cpython-37.pyc
| |
| +---static
| | +---admin
| | | +---css
| | | | | autocomplete.css
| | | | | base.css
| | | | | changelists.css
| | | | | dashboard.css
| | | | | fonts.css
| | | | | forms.css
| | | | | login.css
| | | | | responsive.css
| | .
.
.
.
.
something like this
这是已安装应用程序的片段
解决方案
推荐阅读
- c - 管道到 hexdump 时,用汇编编写的程序没有输出
- python - Raspberry Pi / 数字光强光敏传感器模块
- django - Django/Wagtail ImportError:无法从“django.db.models.fields”导入名称“FieldDoesNotExist”
- sql - 具有不同条件的多列 SQL 查询
- angular - 如何使用 select 禁用/启用特殊行值?
- c# - 从 DbContext c# 的特定子方法调用父方法 DbContext.SaveChanges()
- python - Openpyxl 次要网格线
- r - 如何合并长度不等的数据框列表?
- java - 如何处理 querydsl 多个模式具有相同的表名?
- kubernetes - 如何将使用 Persistent Volume Claim 的 Kubernetes 部署扩展到 2 个 Pod?