django urls without a trailing slash do not redirect

Or you can write your urls like this:

(r'^login/?$', 'mySite.myUser.views.login')

The question sign after the trailing slash makes it optional in regexp. Use it if for some reasons you don’t want to use APPEND_SLASH setting.

Leave a Comment