许多有用的django快捷方式和辅助工具
项目描述
Django-common提供用于开发django项目的有用快捷方式。
概述
context_processors
settings_processor - 将django.conf.settings放入RequestContext
装饰器
render_to - 经典的render_to功能
paged - 在响应中使用render_to分页response_qs变量。
ajax - 将视图响应包装成JSON
字段
AutoOneToOneField - 自动创建相关对象的OneToOne字段
表单
build_form - 一行代码创建GET/POST表单的快捷方式
http
HttpResponseJson - 包装数据的Response类。在common.decorators.ajax中使用
中间件
LoginRequiredMiddleware - 限制访客访问