John
John

Reputation: 4261

Whats the difference between the 2 url routes in Django?

In Django, we define url mapping in urls.py. Whats the difference between these two?

/app/kill/$
/app/kill$

Upvotes: 0

Views: 91

Answers (1)

Jonas Geiregat
Jonas Geiregat

Reputation: 5442

They are both very different urls. But for must users they will be expected to be the same so django has a nice feature for this: the APPEND_SLASH settings variable. From the docs:

When set to True, if the request URL does not match any of the patterns in the URLconf and it doesn't end in a slash, an HTTP redirect is issued to the same URL with a slash appended.

Upvotes: 2

Related Questions