场景: 用户注册的时候,输入用户名之后,Ajax发送请求到后端,后端验证该用户名是否已经被注册,然后返回到注册页面提示用户. 1.模型: from django.db import models class User(models.Model): name = models.CharField(max_length=20) password = models.CharField(max_length=20) 2.路由 from django.contrib import admin from d
AllowAutoRedirect property is true, the Referer property is set automatically when the request is redirected to another site.">如果 AllowAutoRedirect 属性为 true,则 Referer 属性在请求被重定向到另一个站点时自动设置. Referer HTTP header, set the Referer property to null.&quo