Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

230907笔记:Django Docker #6

Open
Geekiter opened this issue Dec 5, 2023 · 0 comments
Open

230907笔记:Django Docker #6

Geekiter opened this issue Dec 5, 2023 · 0 comments
Labels

Comments

@Geekiter
Copy link
Owner

Geekiter commented Dec 5, 2023

记录一下吧,遇到了一个很奇怪的问题。我的 Django 程序突然无法正常运行了,所以我决定修复一下。

我的情况是这样的:
Django 运行在 Docker 容器中,而 Nginx 运行在主机系统上。

Q1:访问 Django 的接口时,返回 502 错误。

Nginx 的错误日志显示如下:

recv() failed (104: Unknown error) while reading response header from up

Docker 容器中的 Django 没有运行起来,可能的原因是我在构建镜像时禁用了自动启动的选项。我担心自动启动可能会导致容器无法进入。

Q2:错误提示信息为 "none is not an allowed value"。

在代码中添加了一个选项,并标注为可选的。

from typing import Optional

Optional[str]
@Geekiter Geekiter added the python label Dec 5, 2023
@Geekiter Geekiter reopened this Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant