1、请求头获取用户设备
from django.core.handlers.wgi import WSGIRequest
request.environ.get('HTTP_USER_AGENT')
2.点赞效果:
<span>+1<span>
tag = document.createElement('span')
tag.innerHTML = "+1"
tag.style.positon = 'absolute'
tag.style.opacity = 1
var obj = setInterval (function(){
},50)
4、Django ORM操作
-字段
class User(models.Model)
u = 字段()
用处;
a.admin中验证
b. obj.clesn_fields()
c. form 组件验证, model组件操作数据(推荐)
d. ModelForm