Django的HTML压缩程序;
django-compresshtml的Python项目详细描述
django compress html
===
django的html compressor
为什么要压缩html代码?
==
==
压缩HTML代码时,可以减小从服务器传输到客户端的数据大小,加快页面加载速度。
对于安装django compressHTML,在终端上运行:::
$[sudo]pip使用midleware安装django compress html
'compresshtml.middleware.compresshtmlmiddleware',
如果要在启用“调试”时缩小HTML代码,只需将其设置为“true”。
如果要保留注释,请将设置“keep_comments_on_compressing”设置为“true”:
keep_comments_on_compressing=true
您只能在要缩小响应的视图上使用:
从compresshtml.decorators导入压缩的响应
@compressed的响应
def home(请求):
返回render的响应('home.html')
development的源代码https://github.com/kamagatos/django compresshtml>;`
*报告有关“github问题”的问题<;https://github.com/kamagatos/django compresshtml/issues>;`
pull请求非常受欢迎!
changelog
==
>0.1
----
*初始提交
许可证
==
除非另有说明,否则django compresshtml源文件是在许可证文件中找到的bsd样式许可证下分发的。
===
django的html compressor
为什么要压缩html代码?
==
==
压缩HTML代码时,可以减小从服务器传输到客户端的数据大小,加快页面加载速度。
对于安装django compressHTML,在终端上运行:::
$[sudo]pip使用midleware安装django compress html
'compresshtml.middleware.compresshtmlmiddleware',
如果要在启用“调试”时缩小HTML代码,只需将其设置为“true”。
如果要保留注释,请将设置“keep_comments_on_compressing”设置为“true”:
keep_comments_on_compressing=true
您只能在要缩小响应的视图上使用:
从compresshtml.decorators导入压缩的响应
@compressed的响应
def home(请求):
返回render的响应('home.html')
development的源代码https://github.com/kamagatos/django compresshtml>;`
*报告有关“github问题”的问题<;https://github.com/kamagatos/django compresshtml/issues>;`
pull请求非常受欢迎!
changelog
==
>0.1
----
*初始提交
许可证
==
除非另有说明,否则django compresshtml源文件是在许可证文件中找到的bsd样式许可证下分发的。