I've made a Django application that uses tags. When i use tag 'c#' and try to redirect to mysiteaddress/tags/c# on server it redirects to ../tags/c and shows me stuff connected to 'c' tag, but when I do the same on my local development machine it redirects me to c%23 and works correctly. What should I change to make it work on production server?
A:
Without more code I can't be too specific, but '#' corresponds to the character escape sequence %23 and something in your code may need to explicitly escape 'c#' before putting it in the url.
Here is a django-snippet that uses url-quoting:
http://www.djangosnippets.org/snippets/1159/
The solution to your problem might look like this:
from django.utils.http import urlquote
...
tag = urlquote(tag)
tag_url = base + "tags/" + tag
...
Danny Roberts
2010-01-09 21:13:01
But why it works on development machine and wont work on production? Is this possible that server is mis configured?
Lhiash
2010-01-09 21:14:50
I agree with you that this is strange.
Danny Roberts
2010-01-09 21:16:23
Thx for the link but I already use url-quoting, unfortunately I cant provide any code atm because I accidentally ruined my development machine, and it will take me some time to restore it.
Lhiash
2010-01-09 21:19:09