Я продолжаю получать ошибку «ModuleNotFoundError at /», когда пытаюсь посетить свое приложение Heroku. Он отлично работает, когда я запускаю его на localhost:8000
.
Мой каталог проекта выглядит так:
главная страница
- pycache (папка)
-migrations (папка)
-templates (папка)
-__ init.py __
-admin.py
-apps. py
-forms.py
-models.py
-tests.py
-urls.py
-views. py
Ошибка журнала:
ModuleNotFoundError at /
No module named 'frontpage.forms'
Request Method: GET
Request URL: http://cottonthebutton.herokuapp.com/
Django Version: 3.0.8
Exception Type: ModuleNotFoundError
Exception Value:
No module named 'frontpage.forms'
Exception Location: /app/frontpage/views.py in <module>, line 5
Python Executable: /app/.heroku/python/bin/python
Python Version: 3.8.5
Python Path:
['/app/.heroku/python/bin',
'/app',
'/app/.heroku/python/lib/python38.zip',
'/app/.heroku/python/lib/python3.8',
'/app/.heroku/python/lib/python3.8/lib-dynload',
'/app/.heroku/python/lib/python3.8/site-packages']
Server time: Sat, 1 Aug 2020 19:16:39 +0800
Отслеживание:
Environment:
Request Method: GET
Request URL: http://cottonthebutton.herokuapp.com/
Django Version: 3.0.8
Python Version: 3.8.5
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'frontpage']
Installed Middleware:
('whitenoise.middleware.WhiteNoiseMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/app/.heroku/python/lib/python3.8/site-packages/django/core/handlers/base.py", line 100, in _get_response
resolver_match = resolver.resolve(request.path_info)
File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/resolvers.py", line 544, in resolve
for pattern in self.url_patterns:
File "/app/.heroku/python/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/resolvers.py", line 588, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/app/.heroku/python/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/resolvers.py", line 581, in urlconf_module
return import_module(self.urlconf_name)
File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
<source code not available>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
<source code not available>
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
<source code not available>
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
<source code not available>
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
<source code not available>
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
<source code not available>
File "/app/PersonalWebsite/urls.py", line 21, in <module>
path('', include('frontpage.urls'))
File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
<source code not available>
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
<source code not available>
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
<source code not available>
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
<source code not available>
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
<source code not available>
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
<source code not available>
File "/app/frontpage/urls.py", line 2, in <module>
from frontpage import views
File "/app/frontpage/views.py", line 5, in <module>
from frontpage.forms import MessageForm
Exception Type: ModuleNotFoundError at /
Exception Value: No module named 'frontpage.forms'