/usr/share/doc/python-django-assets-doc/html/settings.html is in python-django-assets-doc 0.11-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Settings — django-assets 0.11 documentation</title>
<link rel="stylesheet" href="_static/theme_customize.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.11',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="django-assets 0.11 documentation" href="index.html" />
<link rel="prev" title="Jinja2 support" href="jinja2.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="jinja2.html" title="Jinja2 support"
accesskey="P">previous</a> |</li>
<li><a href="index.html">django-assets 0.11 documentation</a> »</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="jinja2.html"
title="previous chapter">Jinja2 support</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/settings.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="settings">
<h1>Settings<a class="headerlink" href="#settings" title="Permalink to this headline">¶</a></h1>
<p>There are a bunch of values which you can define in your Django <tt class="docutils literal"><span class="pre">settings</span></tt>
module to modify the behaviour of <tt class="docutils literal"><span class="pre">webassets</span></tt>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This document places those values inside the <tt class="docutils literal"><span class="pre">django_assets.settings</span></tt>
module. This is irrelevant. To change the values, you need to define them
in your project’s global settings.</p>
</div>
<dl class="data">
<dt id="django_assets.settings.ASSETS_ROOT">
<tt class="descclassname">django_assets.settings.</tt><tt class="descname">ASSETS_ROOT</tt><a class="headerlink" href="#django_assets.settings.ASSETS_ROOT" title="Permalink to this definition">¶</a></dt>
<dd><p>The base directory to which all paths will be relative to,
unless <tt class="xref py py-attr docutils literal"><span class="pre">load_paths</span></tt> are given, in which case this will
only serve as the output directory.</p>
<p>In the url space, it is mapped to <tt class="xref py py-attr docutils literal"><span class="pre">urls</span></tt>.</p>
<p>By default,
<tt class="docutils literal"><span class="pre">STATIC_ROOT</span></tt> will be used for this, or the older <tt class="docutils literal"><span class="pre">MEDIA_ROOT</span></tt>
setting.</p>
</dd></dl>
<dl class="data">
<dt id="django_assets.settings.ASSETS_URL">
<tt class="descclassname">django_assets.settings.</tt><tt class="descname">ASSETS_URL</tt><a class="headerlink" href="#django_assets.settings.ASSETS_URL" title="Permalink to this definition">¶</a></dt>
<dd><p>The url prefix used to construct urls for files in
<tt class="xref py py-attr docutils literal"><span class="pre">directory</span></tt>.</p>
<p>To define url spaces for other directories, see
<tt class="xref py py-attr docutils literal"><span class="pre">url_mapping</span></tt>.</p>
<p>By default, <tt class="docutils literal"><span class="pre">STATIC_URL</span></tt>
will be used for this, or the older <tt class="docutils literal"><span class="pre">MEDIA_URL</span></tt> setting.</p>
</dd></dl>
<span class="target" id="django-setting-debug"></span><dl class="data">
<dt id="django_assets.settings.ASSETS_DEBUG">
<tt class="descclassname">django_assets.settings.</tt><tt class="descname">ASSETS_DEBUG</tt><a class="headerlink" href="#django_assets.settings.ASSETS_DEBUG" title="Permalink to this definition">¶</a></dt>
<dd><p>Enable/disable debug mode. Possible values are:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">False</span></tt></dt>
<dd>Production mode. Bundles will be merged and filters applied.</dd>
<dt><tt class="docutils literal"><span class="pre">True</span></tt></dt>
<dd>Enable debug mode. Bundles will output their individual source
files.</dd>
<dt><em>“merge”</em></dt>
<dd>Merge the source files, but do not apply filters.</dd>
</dl>
</dd></dl>
<dl class="data">
<dt id="django_assets.settings.ASSETS_AUTO_BUILD">
<tt class="descclassname">django_assets.settings.</tt><tt class="descname">ASSETS_AUTO_BUILD</tt><a class="headerlink" href="#django_assets.settings.ASSETS_AUTO_BUILD" title="Permalink to this definition">¶</a></dt>
<dd><p>Controls whether bundles should be automatically built, and
rebuilt, when required (if set to <tt class="docutils literal"><span class="pre">True</span></tt>), or whether they
must be built manually be the user, for example via a management
command.</p>
<p>This is a good setting to have enabled during debugging, and can
be very convenient for low-traffic sites in production as well.
However, there is a cost in checking whether the source files
have changed, so if you care about performance, or if your build
process takes very long, then you may want to disable this.</p>
<p>By default automatic building is enabled.</p>
</dd></dl>
<dl class="data">
<dt id="django_assets.settings.ASSETS_URL_EXPIRE">
<tt class="descclassname">django_assets.settings.</tt><tt class="descname">ASSETS_URL_EXPIRE</tt><a class="headerlink" href="#django_assets.settings.ASSETS_URL_EXPIRE" title="Permalink to this definition">¶</a></dt>
<dd><p>If you send your assets to the client using a
<em>far future expires</em> header (to minimize the 304 responses
your server has to send), you need to make sure that assets
will be reloaded by the browser when they change.</p>
<p>If this is set to <tt class="docutils literal"><span class="pre">True</span></tt>, then the Bundle URLs generated by
webassets will have their version (see <tt class="docutils literal"><span class="pre">Environment.versions</span></tt>)
appended as a querystring.</p>
<p>An alternative approach would be to use the <tt class="docutils literal"><span class="pre">%(version)s</span></tt>
placeholder in the bundle output file.</p>
<p>The default behavior (indicated by a <tt class="docutils literal"><span class="pre">None</span></tt> value) is to add
an expiry querystring if the bundle does not use a version
placeholder.</p>
</dd></dl>
<dl class="data">
<dt id="django_assets.settings.ASSETS_VERSIONS">
<tt class="descclassname">django_assets.settings.</tt><tt class="descname">ASSETS_VERSIONS</tt><a class="headerlink" href="#django_assets.settings.ASSETS_VERSIONS" title="Permalink to this definition">¶</a></dt>
<dd><p>Defines what should be used as a Bundle <tt class="docutils literal"><span class="pre">version</span></tt>.</p>
<p>A bundle’s version is what is appended to URLs when the
<tt class="docutils literal"><span class="pre">url_expire</span></tt> option is enabled, and the version can be part
of a Bundle’s output filename by use of the <tt class="docutils literal"><span class="pre">%(version)s</span></tt>
placeholder.</p>
<p>Valid values are:</p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">timestamp</span></tt></dt>
<dd>The version is determined by looking at the mtime of a
bundle’s output file.</dd>
<dt><tt class="docutils literal"><span class="pre">hash</span></tt> (default)</dt>
<dd>The version is a hash over the output file’s content.</dd>
<dt><tt class="docutils literal"><span class="pre">False</span></tt>, <tt class="docutils literal"><span class="pre">None</span></tt></dt>
<dd>Functionality that requires a version is disabled. This
includes the <tt class="docutils literal"><span class="pre">url_expire</span></tt> option, the <tt class="docutils literal"><span class="pre">auto_build</span></tt>
option, and support for the %(version)s placeholder.</dd>
</dl>
<p>Any custom version implementation.</p>
</div></blockquote>
</dd></dl>
<dl class="data">
<dt id="django_assets.settings.ASSETS_MANIFEST">
<tt class="descclassname">django_assets.settings.</tt><tt class="descname">ASSETS_MANIFEST</tt><a class="headerlink" href="#django_assets.settings.ASSETS_MANIFEST" title="Permalink to this definition">¶</a></dt>
<dd><p>A manifest persists information about the versions bundles
are at.</p>
<p>The Manifest plays a role only if you insert the bundle version
in your output filenames, or append the version as a querystring
to the url (via the <tt class="docutils literal"><span class="pre">url_expire</span></tt> option). It serves two
purposes:</p>
<blockquote>
<div><ul class="simple">
<li>Without a manifest, it may be impossible to determine the
version at runtime. In a deployed app, the media files may
be stored on a different server entirely, and be
inaccessible from the application code. The manifest,
if shipped with your application, is what still allows to
construct the proper URLs.</li>
<li>Even if it were possible to determine the version at
runtime without a manifest, it may be a costly process,
and using a manifest may give you better performance. If
you use a hash-based version for example, this hash would
need to be recalculated every time a new process is
started.</li>
</ul>
</div></blockquote>
<p>Valid values are:</p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">"cache"</span></tt> (default)</dt>
<dd>The cache is used to remember version information. This
is useful to avoid recalculating the version hash.</dd>
<dt><tt class="docutils literal"><span class="pre">"file:{path}"</span></tt></dt>
<dd>Stores version information in a file at {path}. If not
path is given, the manifest will be stored as
<tt class="docutils literal"><span class="pre">.webassets-manifest</span></tt> in <tt class="docutils literal"><span class="pre">Environment.directory</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">"json:{path}"</span></tt></dt>
<dd>Same as “file:{path}”, but uses JSON to store the information.</dd>
<dt><tt class="docutils literal"><span class="pre">False</span></tt>, <tt class="docutils literal"><span class="pre">None</span></tt></dt>
<dd>No manifest is used.</dd>
</dl>
<p>Any custom manifest implementation.</p>
</div></blockquote>
</dd></dl>
<dl class="data">
<dt id="django_assets.settings.ASSETS_CACHE">
<tt class="descclassname">django_assets.settings.</tt><tt class="descname">ASSETS_CACHE</tt><a class="headerlink" href="#django_assets.settings.ASSETS_CACHE" title="Permalink to this definition">¶</a></dt>
<dd><p>Controls the behavior of the cache. The cache will speed up rebuilding
of your bundles, by caching individual filter results. This can be
particularly useful while developing, if your bundles would otherwise take
a long time to rebuild.</p>
<p>Possible values are:</p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">False</span></tt></dt>
<dd>Do not use the cache.</dd>
<dt><tt class="docutils literal"><span class="pre">True</span></tt> (default)</dt>
<dd>Cache using default location, a <tt class="docutils literal"><span class="pre">.webassets-cache</span></tt> folder inside
<tt class="xref py py-attr docutils literal"><span class="pre">directory</span></tt>.</dd>
<dt><em>custom path</em></dt>
<dd>Use the given directory as the cache directory.</dd>
</dl>
</div></blockquote>
</dd></dl>
<dl class="data">
<dt id="django_assets.settings.ASSETS_JINJA2_EXTENSIONS">
<tt class="descclassname">django_assets.settings.</tt><tt class="descname">ASSETS_JINJA2_EXTENSIONS</tt><a class="headerlink" href="#django_assets.settings.ASSETS_JINJA2_EXTENSIONS" title="Permalink to this definition">¶</a></dt>
<dd><p>This is needed in some cases when you want to use <tt class="docutils literal"><span class="pre">django-assets</span></tt> with
the Jinja 2 template system. It should be a list of extensions you are
using with Jinja 2, using which it should be possible to construct a
Jinja 2 environment which can parse your templates. For more information,
see <a class="reference internal" href="jinja2.html"><em>Jinja2 support</em></a>.</p>
</dd></dl>
<span class="target" id="django-setting-modules"></span><dl class="data">
<dt id="django_assets.settings.ASSETS_MODULES">
<tt class="descclassname">django_assets.settings.</tt><tt class="descname">ASSETS_MODULES</tt><a class="headerlink" href="#django_assets.settings.ASSETS_MODULES" title="Permalink to this definition">¶</a></dt>
<dd><p><tt class="docutils literal"><span class="pre">django-assets</span></tt> will automatically look for <tt class="docutils literal"><span class="pre">assets.py</span></tt> files in each
application, where you can register your bundles. If you want additional
modules to be loaded, you can define this setting. It expects a list of
importable modules:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">ASSETS_MODULES</span> <span class="o">=</span> <span class="p">[</span>
<span class="s">'myproject.assets'</span>
<span class="p">]</span>
</pre></div>
</div>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="jinja2.html" title="Jinja2 support"
>previous</a> |</li>
<li><a href="index.html">django-assets 0.11 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2012, Michael Elsdörfer.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>
</html>
|