摘要:
1. 设置cookie 值 request.session['info'] = {'id': admin_row.id, 'name': admin_row.username} 2. 获取cookie info_dict = request.session.get['info'] info_dict 阅读全文
posted @ 2022-04-12 16:32
我在春天等伱
阅读(397)
评论(0)
推荐(0)
摘要:
1. 建立文件夹 创建文件 auth.py from django.utils.deprecation import MiddlewareMixin from django.shortcuts import redirect '''中间件''' class AuthMiddleware(Middle 阅读全文
posted @ 2022-04-12 16:17
我在春天等伱
阅读(121)
评论(0)
推荐(0)
摘要:
account.py 页面 from django.shortcuts import render, redirect from django import forms from app import models from app.utils.encrypt import md5 from app 阅读全文
posted @ 2022-04-12 14:22
我在春天等伱
阅读(119)
评论(0)
推荐(0)