2👍
A random stab at this, without knowing enough info yet…
Its possible that what is happening, is the first request goes through the web server and on to django. Django redirects to a new url with query string, and then the request goes back through the webserver again. At that point, I think the web server is splitting up the pattern improperly. Normally when I see this, the webserver wants to see a trailing slash on the pattern to inform it that it should treat the entire url pattern raw:
So try this maybe (adding trailing slash):
return redirect('/add/?c='+str(rm.id))
return redirect('/add/?success')
Other than this, you might need to go into more detail about your production web server.
If your production server really is performing the redirect, and not django, then you should definitely look into making sure the trailing slash is present in the rule.
Update: Based on the added nginx conf
I think your problem might be your rewrite rule for https. Its quite possibly re-appending the query string because of a single missing ?
http://wiki.nginx.org/HttpRewriteModule
If in the line of replacement arguments are indicated, then the rest
of the request arguments are appended to them. To avoid having them
appended, place a question mark as the last character:
rewrite ^/users/(.*)$ /show?user=$1? last;
Try making this change in your nginx conf:
location / {
rewrite ^ https://****.com$request_uri? permanent;
}
Lastly, just to address your comment about the behavior of your https redirect, I think you might want to adjust that as well. I actually do something almost exactly the same on one of my servers. But I make the ssl server default, and I don’t use a location directive in the port 80 server:
server {
server_name www.foo.com foo.com;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 default_server ssl;
...
}