Проблема развертывания Heroku: ModuleNotFoundError: нет модуля с именем FatCatFi sh .wsgi - PullRequest
0 голосов
/ 26 мая 2020

Я пытаюсь развернуть приложение с полным стеком с серверной частью django. Локально все работало нормально, и heroku сообщает, что сборка прошла успешно, но веб-сервер не запускается. Что мне не хватает? Нужно ли мне запускать проект и выполнять миграции?

Procfile находится в моем проекте root, а мой manage.py находится в FatCatFi sh.

Procfile

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

wsgi:

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

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'FatCatFish.settings')

application = get_wsgi_application()
application = DjangoWhiteNoise(application)

Журнал:

2020-05-25T23:26:31.413415+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-25T23:26:44.404022+00:00 heroku[web.1]: Starting process with command `gunicorn FatCatFish.wsgi --log-file -`
2020-05-25T23:26:47.619979+00:00 heroku[web.1]: Process exited with status 3
2020-05-25T23:26:47.668525+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-25T23:26:47.481429+00:00 app[web.1]: [2020-05-25 23:26:47 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-05-25T23:26:47.482134+00:00 app[web.1]: [2020-05-25 23:26:47 +0000] [4] [INFO] Listening at: http://0.0.0.0:46677 (4)
2020-05-25T23:26:47.482290+00:00 app[web.1]: [2020-05-25 23:26:47 +0000] [4] [INFO] Using worker: sync
2020-05-25T23:26:47.487376+00:00 app[web.1]: [2020-05-25 23:26:47 +0000] [10] [INFO] Booting worker with pid: 10
2020-05-25T23:26:47.494729+00:00 app[web.1]: [2020-05-25 23:26:47 +0000] [10] [ERROR] Exception in worker process
...
2020-05-25T23:26:47.494768+00:00 app[web.1]: ModuleNotFoundError: No module named 'FatCatFish.wsgi'

Файлы и папки в каталоге root:

FatCatFish
│   manage.py
│
├───FatCatFish
│   │   asgi.py
│   │   settings.py
│   │   urls.py
│   │   wsgi.py
│   │   __init__.py
│   │
│   └───__pycache__
│           settings.cpython-37.pyc
│           urls.cpython-37.pyc
│           wsgi.cpython-37.pyc
│           __init__.cpython-37.pyc
│
├───frontend
│   │   admin.py
│   │   apps.py
│   │   models.py
│   │   tests.py
│   │   urls.py
│   │   views.py
│   │   __init__.py
│   │
│   ├───migrations
│   │   │   __init__.py
│   │   │
│   │   └───__pycache__
│   │           __init__.cpython-37.pyc
│   │
│   ├───src
│   │   │   index.js
│   │   │   store.js
│   │   │
│   │   ├───actions
│   │   │       auth.js
│   │   │       messages.js
│   │   │       plans.js
│   │   │       temperatures.js
│   │   │       tickets.js
│   │   │       types.js
│   │   │       users.js
│   │   │
│   │   ├───components
│   │   │   │   App.js
│   │   │   │
│   │   │   ├───common
│   │   │   │       PrivateRoute.js
│   │   │   │
│   │   │   ├───layout
│   │   │   │       Alerts.js
│   │   │   │       Header.js
│   │   │   │
│   │   │   ├───logindashboard
│   │   │   │       LoginDashboard.js
│   │   │   │
│   │   │   ├───plans
│   │   │   │       Dashboard.js
│   │   │   │       Form.js
│   │   │   │       Plans.js
│   │   │   │
│   │   │   ├───temperatures
│   │   │   │       TemperaturesCharts.js
│   │   │   │       TemperaturesDashboard.js
│   │   │   │       TemperatureSetup.js
│   │   │   │       TemperaturesNow.js
│   │   │   │
│   │   │   ├───tickets
│   │   │   │       CategoryForm.js
│   │   │   │       RepairForm.js
│   │   │   │       TicketDashboard.js
│   │   │   │       TicketForm.js
│   │   │   │       Tickets.js
│   │   │   │
│   │   │   └───users
│   │   │           Login.js
│   │   │           UpdateUser.js
│   │   │           UserDashboard.js
│   │   │           UserForm.js
│   │   │           Users.js
│   │   │
│   │   └───reducers
│   │           auth.js
│   │           errors.js
│   │           index.js
│   │           messages.js
│   │           plans.js
│   │           temperatures.js
│   │           tickets.js
│   │           users.js
│   │
│   ├───static
│   │   ├───css
│   │   │       sticky-footer-navbar.css
│   │   │       styles.css
│   │   │
│   │   ├───frontend
│   │   │       main.js
│   │   │
│   │   └───images
│   │           404_banana_splits.jpg
│   │           500_catboat.jpg
│   │           top_gradient.gif
│   │
│   ├───templates
│   │   │   403.html
│   │   │   404.html
│   │   │   500.html
│   │   │   base.html
│   │   │   home.html
│   │   │
│   │   ├───frontend
│   │   │       index.html
│   │   │
│   │   └───registration
│   │           login.html
│   │
│   └───__pycache__
│           admin.cpython-37.pyc
│           models.cpython-37.pyc
│           tests.cpython-37.pyc
│           urls.cpython-37.pyc
│           views.cpython-37.pyc
│           __init__.cpython-37.pyc
│
├───plans
│   │   admin.py
│   │   api.py
│   │   apps.py
│   │   models.py
│   │   serializers.py
│   │   tests.py
│   │   urls.py
│   │   views.py
│   │   __init__.py
│   │
│   ├───migrations
│   │   │   0001_initial.py
│   │   │   0002_auto_20200302_1807.py
│   │   │   0003_auto_20200517_1008.py
│   │   │   0004_auto_20200523_1201.py
│   │   │   __init__.py
│   │   │
│   │   └───__pycache__
│   │           0001_initial.cpython-37.pyc
│   │           0002_auto_20200302_1807.cpython-37.pyc
│   │           0003_auto_20200517_1008.cpython-37.pyc
│   │           0004_auto_20200523_1201.cpython-37.pyc
│   │           __init__.cpython-37.pyc
│   │
│   └───__pycache__
│           admin.cpython-37.pyc
│           api.cpython-37.pyc
│           models.cpython-37.pyc
│           serializers.cpython-37.pyc
│           tests.cpython-37.pyc
│           urls.cpython-37.pyc
│           __init__.cpython-37.pyc
│
├───staticfiles
├───temperatures
│   │   admin.py
│   │   api.py
│   │   apps.py
│   │   models.py
│   │   serializers.py
│   │   tests.py
│   │   urls.py
│   │   views.py
│   │   __init__.py
│   │
│   ├───migrations
│   │   │   0001_initial.py
│   │   │   0002_temp_active.py
│   │   │   0003_auto_20200405_1638.py
│   │   │   0004_auto_20200406_2031.py
│   │   │   0005_sourcemap_active.py
│   │   │   __init__.py
│   │   │
│   │   └───__pycache__
│   │           0001_initial.cpython-37.pyc
│   │           0002_temp_active.cpython-37.pyc
│   │           0003_auto_20200405_1638.cpython-37.pyc
│   │           0004_auto_20200406_2031.cpython-37.pyc
│   │           0005_sourcemap_active.cpython-37.pyc
│   │           __init__.cpython-37.pyc
│   │
│   └───__pycache__
│           admin.cpython-37.pyc
│           api.cpython-37.pyc
│           models.cpython-37.pyc
│           serializers.cpython-37.pyc
│           urls.cpython-37.pyc
│           __init__.cpython-37.pyc
│
├───tickets
│   │   admin.py
│   │   api.py
│   │   apps.py
│   │   models.py
│   │   serializers.py
│   │   tests.py
│   │   urls.py
│   │   views.py
│   │   __init__.py
│   │
│   ├───migrations
│   │   │   0001_initial.py
│   │   │   0002_auto_20200423_1533.py
│   │   │   __init__.py
│   │   │
│   │   └───__pycache__
│   │           0001_initial.cpython-37.pyc
│   │           0002_auto_20200423_1533.cpython-37.pyc
│   │           __init__.cpython-37.pyc
│   │
│   └───__pycache__
│           admin.cpython-37.pyc
│           api.cpython-37.pyc
│           models.cpython-37.pyc
│           serializers.cpython-37.pyc
│           urls.cpython-37.pyc
│           views.cpython-37.pyc
│           __init__.cpython-37.pyc
│
└───users
    │   admin.py
    │   api.py
    │   apps.py
    │   forms.py
    │   models.py
    │   serializers.py
    │   tests.py
    │   urls.py
    │   views.py
    │   __init__.py
    │
    ├───migrations
    │   │   0001_initial.py
    │   │   __init__.py
    │   │
    │   └───__pycache__
    │           0001_initial.cpython-37.pyc
    │           0002_customuser_starttime.cpython-37.pyc
    │           __init__.cpython-37.pyc
    │
    └───__pycache__
            admin.cpython-37.pyc
            api.cpython-37.pyc
            apps.cpython-37.pyc
            forms.cpython-37.pyc
            models.cpython-37.pyc
            serializers.cpython-37.pyc
            tests.cpython-37.pyc
            urls.cpython-37.pyc
            __init__.cpython-37.pyc

Выше приведены требования и procfile.

1 Ответ

0 голосов
/ 26 мая 2020
web: gunicorn --pythonpath FatCatFish FatCatFish.wsgi --log-file -

- путь pythonpathToWSGIFile wsgiFile

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...