Heroku(Django Web 应用程序)上的应用程序错误

发布于 2025-01-11 13:03:49 字数 3298 浏览 0 评论 0原文

我正在尝试在 Heroku 上部署我的 Django Web 应用程序。构建成功,但我仍然收到应用程序错误。以下是我的应用程序的日志。

日志:

2022-03-04T12:47:48.701018+00:00 app[web.1]:   File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
2022-03-04T12:47:48.701018+00:00 app[web.1]: ModuleNotFoundError: No module named 'SASTRAScrapper'
2022-03-04T12:47:48.701025+00:00 app[web.1]: [2022-03-04 12:47:48 +0000] [9] [INFO] Worker exiting (pid: 9)
2022-03-04T12:47:48.745701+00:00 app[web.1]: [2022-03-04 12:47:48 +0000] [4] [WARNING] Worker with pid 9 was terminated due to signal 15
2022-03-04T12:47:48.841738+00:00 app[web.1]: [2022-03-04 12:47:48 +0000] [4] [INFO] Shutting down: Master
2022-03-04T12:47:48.841740+00:00 app[web.1]: [2022-03-04 12:47:48 +0000] [4] [INFO] Reason: Worker failed to boot.
2022-03-04T12:47:49.032701+00:00 heroku[web.1]: Process exited with status 3
2022-03-04T12:47:49.097253+00:00 heroku[web.1]: State changed from up to crashed
2022-03-04T12:48:02.499473+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sastra-scraper.herokuapp.com request_id=f5454869-83fe-41bc-a081-a0b11b419ad1 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:48:03.140143+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sastra-scraper.herokuapp.com request_id=8e31ba10-6112-41f6-b8f8-6c58e86acb4a fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:00.300756+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sastra-scraper.herokuapp.com request_id=e0c472d9-2ce4-4c99-9048-87e95a834255 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:00.916514+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sastra-scraper.herokuapp.com request_id=f4a4d43f-aa19-4784-9602-f897e2a71238 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:04.938317+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sastra-scraper.herokuapp.com request_id=8e3167e6-c97e-42e7-8fe0-1e2a5136acc4 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:05.403850+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sastra-scraper.herokuapp.com request_id=42a92e54-37cc-483d-8766-081783ac8695 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:27.736824+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sastra-scraper.herokuapp.com request_id=1e7767fc-74d8-4c4d-917d-a5e39c798823 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:28.323634+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sastra-scraper.herokuapp.com request_id=41740811-72fc-4360-90f3-4d14a3c27b96 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https

GitHub Repo

请帮助我!

I am trying to deploy my Django web-app on Heroku. Build succeeds but still I get an Application Error. Below are my app's logs.

Logs:

2022-03-04T12:47:48.701018+00:00 app[web.1]:   File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
2022-03-04T12:47:48.701018+00:00 app[web.1]: ModuleNotFoundError: No module named 'SASTRAScrapper'
2022-03-04T12:47:48.701025+00:00 app[web.1]: [2022-03-04 12:47:48 +0000] [9] [INFO] Worker exiting (pid: 9)
2022-03-04T12:47:48.745701+00:00 app[web.1]: [2022-03-04 12:47:48 +0000] [4] [WARNING] Worker with pid 9 was terminated due to signal 15
2022-03-04T12:47:48.841738+00:00 app[web.1]: [2022-03-04 12:47:48 +0000] [4] [INFO] Shutting down: Master
2022-03-04T12:47:48.841740+00:00 app[web.1]: [2022-03-04 12:47:48 +0000] [4] [INFO] Reason: Worker failed to boot.
2022-03-04T12:47:49.032701+00:00 heroku[web.1]: Process exited with status 3
2022-03-04T12:47:49.097253+00:00 heroku[web.1]: State changed from up to crashed
2022-03-04T12:48:02.499473+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sastra-scraper.herokuapp.com request_id=f5454869-83fe-41bc-a081-a0b11b419ad1 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:48:03.140143+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sastra-scraper.herokuapp.com request_id=8e31ba10-6112-41f6-b8f8-6c58e86acb4a fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:00.300756+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sastra-scraper.herokuapp.com request_id=e0c472d9-2ce4-4c99-9048-87e95a834255 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:00.916514+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sastra-scraper.herokuapp.com request_id=f4a4d43f-aa19-4784-9602-f897e2a71238 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:04.938317+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sastra-scraper.herokuapp.com request_id=8e3167e6-c97e-42e7-8fe0-1e2a5136acc4 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:05.403850+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sastra-scraper.herokuapp.com request_id=42a92e54-37cc-483d-8766-081783ac8695 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:27.736824+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sastra-scraper.herokuapp.com request_id=1e7767fc-74d8-4c4d-917d-a5e39c798823 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https
2022-03-04T12:49:28.323634+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sastra-scraper.herokuapp.com request_id=41740811-72fc-4360-90f3-4d14a3c27b96 fwd="122.161.254.213" dyno= connect= service= status=503 bytes= protocol=https

GitHub Repo

Kindly help me out!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

百思不得你姐 2025-01-18 13:03:49

您的 SASTRAScraper/wsgi.py 中有一个拼写错误。

更改

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

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

使其与实际目录名称匹配。

此拼写错误也存在于 SASTRAScraper/asgi.py 中,并且在 SASTRAScraper/urls.py 中也存在注释。我怀疑您在第一次运行 django-admin.py startproject 时拼写错误。

You have a typo in your SASTRAScraper/wsgi.py.

Change

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

to

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

so it matches the actual directory name.

This typo is also present in SASTRAScraper/asgi.py and a comment in SASTRAScraper/urls.py. I suspect you spelled this the wrong way when you first ran django-admin.py startproject.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文