本文介绍了Django的资产经理 - 选择哪一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想捆绑css和javascript文件。我还想向客户端发送远未来的到期标头,所以我需要文件版本控制。



互联网上的快速搜索显示,有几个为Django开发的资产管理器。以下是我可以达到的列表:










他们似乎执行得更多或更少同样的工作django-compress,django-compressor和django-site-assets似乎是乍一看特别有前途的。如果有人提供任何有助于我们之间选择的反馈意见,我将会感激。

解决方案

在竞争者中,我选择了 django-compression ,因为它使用起来非常简单。只需在模板中放置一个或两个标签(典型情况:一个用于css,另一个用于js),大多数情况下,您完成了任何修改;你甚至不必声明或修改设置,其默认设置是好的。


I would like to bundle up css and javascript files. I also want to send far-future expire headers to clients, so I need file versioning.

A quick search across the Internet has shown there are several asset managers developed for Django. Here is a list of those that I could reach:

  1. django-compress
  2. django-assets
  3. django-assetpackager
  4. django-media-bundler
  5. django-mediacat
  6. django-site-assets
  7. django-static-management
  8. django-compressor

They seem to perform more or less the same job. django-compress, django-compressor and django-site-assets seem to be especially promising at the first glance. I will appreciate if someone provides feedback on any of them that will help me choose between them.

解决方案

Among the contenders I have chosen django-compressor because it is incredibly simple to use. Just put one or two tags (typical scenario: one for css and another for js) in the template and for most cases you are done without modifying anything; you don't even have to declare or modify settings, its default settings are good.

这篇关于Django的资产经理 - 选择哪一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 10:25