Django url debugger

前端 未结 4 583
逝去的感伤
逝去的感伤 2021-02-05 03:51

I\'m developing a django application and over time, the URLs have grown. I have a lot of them with me now and due to some change I made, one view started to malfunction. When I

4条回答
  •  广开言路
    2021-02-05 04:04

    You can assume, that it goes through the urlpatterns from top to bottom and the first one that matches will be executed.

    As you know which view is executed (Y) think about that:

    • if Y is before X: the patterns of Y matches the url (but shouldn't)
    • if X is before Y: the patterns of X doesn't match the url (but should)

    Can you provide some more explicit examples of your URLConf? Than I can give you a more explicit answer.

提交回复
热议问题