pythondjangodjango-extensions

What is .<format> argument for?


Docs say

show_urls - Displays the url routes that are defined in your project. Very crude at this point.

I had searched with format keyword. But the results are not related to my question.

Does it stand for ?format=json argument?

I had tried replacing json by html, xml. I got error in return.

Reference: http://django-extensions.readthedocs.io/en/latest/command_extensions.html?highlight=show_urls


Solution

  • In that URL pattern, format is a keyword argument in the URL pattern (unlike ?format=json where it's in the querystring). A matching URL would be:

    /api/userprofiles/5.json/