摘要:
Cookie 装饰器Cookie def check_login(func): @wraps(func) def inner(request, *args, **kwargs): if request.get_signed_cookie("login", salt="SSS", default=No 阅读全文
摘要:
分页 封装 我是在项目根目录创建个分页文件 分页代码: class Pagination(object): def __init__(self, data_num, current_page, url_prefix, per_page=10, max_show=11): """ 进行初始化. :pa 阅读全文
摘要:
Django 单独文件执行 文件 我是在项目根目录文件创建的。 配置文件: #!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MOD 阅读全文