In rails, on can show the active routes with rake (http://guides.rubyonrails.org/routing.html):
$ rake routes users GET /users {:controller=>"users", :action=>"index"} formatted_users GET /users.:format {:controller=>"users", :action=>"index"} POST /users {:controller=>"users", :action=>"create"} POST /users.:format {:controller=>"users", :action=>"create"}
Is there a similar tool/command for django showing the e.g. the URL pattern, the name of the pattern (if any) and the associated function in the views?
Check Routing first, open django_exercise/urls.py file to check django Project Unit Routing. when you open the file, you can see the contents like above. in previous blog post(django Administrator Page), we've opend http://127.0.0.1:8000/admin URL to connect the administrator page.
A URLconf is like a table of contents for your Django-powered Web site. Basically, it's a mapping between URLs and the view functions that should be called for those URLs.
The path function is contained with the django. urls module within the Django project code base. path is used for routing URLs to the appropriate view functions within a Django application using the URL dispatcher.
A route can be defined as a URL that displays a particular web page on the browser. For example, if we want to visit the Educative website, we would head over to https://www.educative.io. Django lets us route URLs however we want and with no framework limitations.
Have found https://github.com/django-extensions/django-extensions:
$ ./manage.py show_urls
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With