django ninja get not allowed 能用 put delete

遇到一个奇怪的问题,django-ninja 编写的 get post 方法不能使用

# 获取Material
@router.get('/material', response=List[MaterialSchemaOut])
@paginate(MyPagination)
def list_material(request, filters: Filters = Query(...)):
    qs = retrieve(request, Material, filters)
    return qs

# 这种可以正常执行
@router.get('/material-222', auth=None)
def execute_task(request):
    print('hello')
    return 'hello'

# 这种就会提示报错,因为django 的 url pattern 解析有问题
@router.get('/material/222', auth=None)
def execute_task(request):
    print('hello')
    return 'hello'

参考
https://github.com/vitalik/django-ninja/issues/203
https://github.com/vitalik/django-ninja/issues/590

相关推荐

  1. harmonyOS HTTP数据请求

    2024-07-13 07:34:02       41 阅读
  2. zookeeper在哪里

    2024-07-13 07:34:02       20 阅读
  3. Python爬虫实现什么?

    2024-07-13 07:34:02       20 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-13 07:34:02       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-13 07:34:02       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-13 07:34:02       58 阅读
  4. Python语言-面向对象

    2024-07-13 07:34:02       69 阅读

热门阅读

  1. 【算法】删除链表的倒数第 N 个结点

    2024-07-13 07:34:02       21 阅读
  2. 力扣-bfs

    2024-07-13 07:34:02       22 阅读
  3. 访问本地SQL Server:巴比达内网穿透的又一妙用

    2024-07-13 07:34:02       23 阅读
  4. 会话固定攻击

    2024-07-13 07:34:02       26 阅读
  5. Json 之 DSL-Json

    2024-07-13 07:34:02       20 阅读
  6. ubuntu添加软件快捷方式

    2024-07-13 07:34:02       18 阅读
  7. 昇思17天

    2024-07-13 07:34:02       21 阅读
  8. Windows图形界面(GUI)-SDK-C/C++ - 列表框(List)

    2024-07-13 07:34:02       26 阅读
  9. string知识点

    2024-07-13 07:34:02       28 阅读