Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (19.9k points)

I have experienced using reverse within get_absolute_url method in the model, but I wish I have an idea about the difference between reverse and redirect, I have tried to search on google about it but there is almost nothing I don't know what should I write also to convince stack overflow that I don't have any other description

1 Answer

0 votes
by (25.1k points)

reverse in Django is used to dynamically get the url of a resource sucha as a view,

eg 

reverse('post-index')

will give '/post/', provided that you have given the urlpattern a name of post-index.

while redirect will redirect a user to another page. In this there is no use of resources.

Related questions

0 votes
1 answer
asked Oct 12, 2019 in Web Technology by Rajesh Malhotra (19.9k points)
0 votes
1 answer
asked Oct 12, 2019 by Rajesh Malhotra (19.9k points)
0 votes
1 answer
asked Nov 25, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer

Browse Categories

...