小编Sev*_*evy的帖子

无法使用 dockerized django 项目运行 vscode 的调试器

每次运行调试器时,都会发生很多事情,但不是我所期望的。

我正在运行一个项目docker-compose up

检查本地主机后端是否正常。它下来了。有趣的是,容器正在运行,因为我使用 vscode 的远程容器连接到它。

库debugpy已安装。

运行调试器的第一种方法以调试控制台中的此类信息结束:

Attached!
System check identified some issues:

WARNINGS:
workflow.State.additional_values: (fields.W904) django.contrib.postgres.fields.JSONField is deprecated. Support for it (except in historical migrations) will be removed in Django 4.0.
    HINT: Use django.db.models.JSONField instead.
Operations to perform:
  Apply all migrations: accounts, auth, contenttypes, files, mambu, otp_totp, sessions, token_blacklist, workflow, zoho
Running migrations:
  No migrations to apply.
Run Code Online (Sandbox Code Playgroud)

它已经下降了。后台也挂了。

第二次尝试:

Attached!
System check identified some issues:

WARNINGS:
workflow.State.additional_values: (fields.W904) django.contrib.postgres.fields.JSONField is deprecated. Support for it (except …
Run Code Online (Sandbox Code Playgroud)

python django docker visual-studio-code vscode-debugger

6
推荐指数
1
解决办法
2230
查看次数

如果值为 false,gRPC 不会返回布尔值

func (m *TodoServer) GetTodos(ctx context.Context, empty *emptypb.Empty) (*desc.GetTodosResponse, error) {
    todos, err := m.todoService.GetTodos()
    if err != nil {
        return nil, err
    }

    todosResp := make([]*desc.GetTodosResponse_Todo, 0, len(todos))
    for _, todo := range todos {
        todosResp = append(todosResp, &desc.GetTodosResponse_Todo{
            Id:          todo.ID,
            Title:       todo.Title,
            IsCompleted: todo.IsCompleted,
        })
    }

    return &desc.GetTodosResponse{Todos: todosResp}, nil
}
Run Code Online (Sandbox Code Playgroud)
service TodoService {
    rpc GetTodos(google.protobuf.Empty) returns (GetTodosResponse) {}
}

message GetTodosResponse {
    repeated Todo todos = 1;
    message Todo {
        int64 id = 1;
        string title = 2; …
Run Code Online (Sandbox Code Playgroud)

go grpc

2
推荐指数
1
解决办法
1676
查看次数

标签 统计

django ×1

docker ×1

go ×1

grpc ×1

python ×1

visual-studio-code ×1

vscode-debugger ×1