Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there something similar to 'rake routes' in django? [duplicate]

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?

like image 838
miku Avatar asked Jan 19 '10 10:01

miku


People also ask

How can I see my route in Django?

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.

What is URLconf in Django?

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.

What is the difference between path and URL in Django?

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.

What are routes in Django?

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.


1 Answers

Have found https://github.com/django-extensions/django-extensions:

$ ./manage.py show_urls 
like image 142
miku Avatar answered Sep 22 '22 00:09

miku