Django : How can I see a list of urlpatterns?

后端 未结 16 1700
有刺的猬
有刺的猬 2020-11-29 19:36

How can I see the current urlpatterns that \"reverse\" is looking in?

I\'m calling reverse in a view with an argument that I think should work, but doesn\'t. Any wa

16条回答
  •  遥遥无期
    2020-11-29 19:42

    If you want a list of all the urls in your project, first you need to install django-extensions, add it to your settings like this:

    INSTALLED_APPS = (
    ...
    'django_extensions',
    ...
    )
    

    And then, run this command in your terminal

    ./manage.py show_urls
    

    For more information you can check the documentation.

提交回复
热议问题