Django ModelAdmin.get_urls() not registering custom urls

前端 未结 1 444
梦谈多话
梦谈多话 2021-01-07 07:14

I am trying to create custom views for my models in Django admin site. I created ModelAdmin for my model named Document like this:

         


        
相关标签:
1条回答
  • 2021-01-07 08:07

    This is just a matter of URL ordering; the generic admin change view is processed first and is capturing your request for "my-view" as a slug. You can change this by putting your URLs first, which is what is actually done in the example you link to:

    return custom_urls + urls
    
    0 讨论(0)
提交回复
热议问题