在我的本地测试机器上它工作正常,但在服务器上它会加倍 GET 参数。
例如,使用以下代码:
return redirect('/add?c='+str(rm.id))
例如,我以 /add?c=3423?c=3423 结尾。
和
return redirect('/add?success')
让我加入 /add?success?success
有谁知道怎么回事?
编辑:这是我的相关行 urls.py 和我的 nginx 配置
url(r'^add/$', 'rumors.views.add'),
server{
listen 0.0.0.0:443 ssl;
server_name www.****.com ****.com;
ssl_certificate /opt/etc/***;
ssl_certificate_key /opt/etc/***;
keepalive_timeout 70;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
auth_basic "Restricted";
auth_basic_user_file /opt/etc/.htpasswd;
uwsgi_pass unix:///tmp/uwsgi_***.sock;
include uwsgi_params;
}
location /static {
# Point this wherever the static files for your django app are stored (i.e. MEDIA_ROOT)
alias /opt/apps/****/static;
}
}
server {
listen 80 default_server;
server_name "";
location / {
rewrite ^ https://****.com$request_uri permanent;
}
}