Friday, December 26, 2014

Re: Django url issues, append slash and case insensitvity

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

On Tuesday, December 23, 2014 12:45:33 PM UTC-6, pythonista wrote:
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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/68644eaf-6817-4ab5-a393-4cea50f0565c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment