每次当我去我的注册页面时,我都会收到此错误
Session data corrupted
Run Code Online (Sandbox Code Playgroud)
当我正在尝试注册时,POST请求状态为302,但仍然创建了用户,但没有将任何电子邮件保存到注册用户.
为什么我收到该错误,我该如何解决?
谢谢!
当我尝试重新启动 nginx 时,出现以下错误
nginx: [warn] conflicting server name "example.io" on 0.0.0.0:80, ignored
Run Code Online (Sandbox Code Playgroud)
我使用我的部署脚本来为 2 个域进行部署。对于第一个,它工作正常,但对于第二个,它会出错。
这是我的 nginx.conf 文件
#
worker_processes 2;
#
user nginx nginx;
#
pid /opt/nginx/pids/nginx.pid;
error_log /opt/nginx/logs/error.log;
#
events {
worker_connections 4096;
}
#
http {
#
log_format full_log '$remote_addr - $remote_user $request_time $upstream_response_time '
'[$time_local] "$request" $status $body_bytes_sent $request_body "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#
access_log /opt/nginx/logs/access.log;
ssl on;
ssl_certificate /opt/nginx/cert/example.crt;
ssl_certificate_key /opt/nginx/cert/example.key;
#
include /opt/nginx/conf/vhosts/*.conf;
# Deny access to any other host
server {
server_name example.io; …Run Code Online (Sandbox Code Playgroud) 我有以下 POST 请求
curl -v --dump-header --H "Content-Type: application/json" -X POST --data '{"name": "John", "age": 27}' "http://localhost:8300/api/v1/create_contact?username=gegham&api_key=3efc6df6023534279d2183a696044a8cfec964a9"
Run Code Online (Sandbox Code Playgroud)
我打印 request.POST 后的结果是
POST:<QueryDict: {u'{"name": "John", "age": 27}': [u'']}>
Run Code Online (Sandbox Code Playgroud)
但不是
POST: <QueryDict: {u'name': [u'John'], u'age': [u'27']}>
Run Code Online (Sandbox Code Playgroud)
所以,我不能将它用作字典并通过键获取值。为什么 POST 数据格式与平常不同??