Django url issues, append slash and case insensitvity

27 views
Skip to first unread message

pythonista

unread,
Dec 23, 2014, 1:45:33 PM12/23/14
to django...@googlegroups.com
I am having some issues with trailing slashes.

The application is working fine from my local machine whether I add a trailing slash or not.

It is not working as expected on the servers.  The link is being redirected to localhost for some reason.


I thought that SLASH_APPEND= True was on by default in the settings.py file.

1. I can add that to the settings file.
url(r'^waitlist/',
2.  I can add    waitlist/?'                                     ( ?)
to each url.  

On my machine the url router goes to the correct page, but it now is missing the /
waitlist/add_account/

now becomes 

waitlistadd_account/    (the middle /   is missing, but the code seems to be working.)

Any help would be appreciated.

While I am on a similar subject,

to make the request case insensitive, if I make the above call like this to make it case insensitive, is this the best way, are there any side effects of this approach?

url(r'^(?i)waitlist/?'

Thanks in advance.

We are using nginx, is there any way to code the case insensitivity piece in there?

Thanks

Bob

Collin Anderson

unread,
Dec 26, 2014, 4:36:11 PM12/26/14
to django...@googlegroups.com
Hi,

waitlist/add_account/ redirecting to waitlistadd_account/ is quite odd to me. Could it simply be a bad cached 301? What does curl -i http://yourdomain/wailtlist/add_account/ say?

Not sure about the case insensitivity. I've never tried it, but can't think of any side effects.

Collin
Reply all
Reply to author
Forward
0 new messages