django 模块功能

时间:2025-02-23 20:17:48

一.  

非常有用的判断处理版本的模块,用于使程序同时兼容python的2版本和3版本。

例如:

.string_types 在 py3 里是类型 str,在py2里是类型 six.string_types。在类型判断时非常有用,提高程序的兼容性。


.

This module converts requested URLs to callback view functions.

URLs 回调 view 函数


例如:

的构造函数会判断参数callback是否为一个字符串(模块路径或view里的函数名)或是一个view中可调用的对象。



.

有三个接口

include(module[namespace=Noneapp_name=None])

include( pattern_list)