[Answered ]-Django Redirect URL

3👍

Surely you must see that there’s a difference between 'good/' and '/good/'? The former will always add itself onto the existing page, whereas the latter will start from the root. This is basic web behaviour, and nothing to do with Django.

In any case, you should never hard-code URLs like that, but should use Django’s URL-reversing functionality to calculate the URLs dynamically.

-1👍

If you want to redirect to urls in your domain, you can use redirect. You can use redirect to view with by using patterns in your urls.py file or to any urls you ‘d like. Although I strongly encourage the usage of views as indicates the different tutorials available on their website.

Better check out django documentation that is one of the most complete out there (to my humble opinion)

/edit for lack of clarity indeed.

Leave a comment