# DB迁移工具

  1. flask的数据迁移
    1. init
    2. migrate
    3. upgrade
  2. django的数据迁移
    1. python manage.py makemigrations
    2. python manage.py migrate
  3. session的使用
def c_title(request): 
    request.session[‘title‘] = request.POST.get(‘title‘) 
    request.session[‘title‘] = request.POST.get(‘name‘) 
    request.session[‘title‘] = request.POST.get(‘content‘) 
    print(request.session.get(‘title‘)) 
    return redirect(‘/three/title’) 


  1. 分页
title = request.session.get(‘title‘) 
name = request.session.get(‘name‘) 
content = request.session.get(‘content‘) 
student_list = Xiaoshuo.objects.all() 
if title: 
    student_list = student_list.objects.filter(title__contains=title) 
if name: 
    student_list = Xiaoshuo.objects.filter(name__contains=name) 
if content: 
    student_list = student_list.objects.filter(content__contains=content) 
print(name) 
//分页,不完全版,可以不通过session来判断
student_list = Xiaoshuo.objects.all().filter(name__contains=name).filter(title__contains=title).filter(content__contains=content) 

# DB迁移工具

上一篇:MON-DB-mysql通过zabbix监控processlist数量


下一篇:Unity AsyncGPUReadback 接口测试