Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-pipeline
Commits
f420dae8
Commit
f420dae8
authored
May 20, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
less chit-chat, more useful docs
parent
f3981488
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
81 deletions
+26
-81
docs/configuration.rst
+14
-5
docs/features.rst
+0
-36
docs/index.rst
+6
-32
docs/installation.rst
+6
-8
docs/usage.rst
+0
-0
No files found.
docs/configuration.rst
View file @
f420dae8
...
...
@@ -67,10 +67,21 @@ Group options
Is the filename of the (to be) compressed file.
``variant``
...........
**Optional**
Is the variant you want to apply to your CSS. This allow you to embed images and
fonts in CSS with data-URI.
Allowed values are : ``None`` or ``datauri``.
Defaults to ``None``.
``extra_context``
.................
**Option
n
al**
**Optional**
Is a dictionary of values to add to the template context,
when generating the HTML for the HTML-tags with the templatetags.
...
...
@@ -92,7 +103,7 @@ Other settings
When ``COMPRESS`` is ``True``, CSS and JavaScripts will be concatenated and filtered.
When ``False``, the source-files will be used instead.
Defaults to ``not DEBUG`` (compressed files will only be used when ``DEBUG`` is ``False``)
Defaults to ``not DEBUG`` (compressed files will only be used when ``DEBUG`` is ``False``)
.
``COMPRESS_AUTO``
.................
...
...
@@ -247,6 +258,4 @@ some horsepower to google which leads us as hinted in the example above to the n
.. note::
external urls is currently only available for javascript. There's currently no
reason to have external css files (Yes there are css frameworks as well on the net
but they are often very small or generated to fit your needs)
External urls is currently only available for javascript.
docs/features.rst
deleted
100644 → 0
View file @
f3981488
.. _ref-features:
========
Features
========
This is a application that will provide an easy and automated way to output
compressed/minified CSS and JavaScript.
It adheres to the DRY principle, you set up your CSS-files and JavaScript-files
in your project settings, and you are done.
There is no need to enter the names in your template again (a couple of template tags takes care of that).
* Group and concatenate your stylesheets and jaavscripts source files to single files,
and run the code through specified compressors.
* Provides sane defaults for CSS and JavaScript minification (YUI compressor required).
* A compressor for **YUI Compressor**, **Google Closure Compiler**, **UglifyJS** is included.
* It’s easy and straightforward to write custom compressors to generate the output.
* A last-modification and/or version part can automatically be appended to the filename
of the outputted files to make use of “far future Expires HTTP header),
and provide an automated way of updating the content without delays.
* You setup and group your CSS and JavaScript-files in the settings,
and set up whetter or not you want your files to be compressed.
* Templatetags to output CSS (``<link>``) or JavaScript (``<script>``) tags
with the compressed files if ``COMPRESS = True``, or otherwise the source files.
* The compressed files will be updated (if needed) when you are accessing them
from the templatetags.
This only applies when ``COMPRESS_AUTO`` is enabled.
You can manually update them with ``./manage.py synccompress``.
docs/index.rst
View file @
f420dae8
...
...
@@ -6,36 +6,11 @@
Introduction
============
JavaScript and CSS minification/compression can decrease load times of sites a lot.
It is important to reduce the number of requests that are made.
Fewer files means better performance. However, when you develop CSS, and particularly
if you are building a big site, it can be nice to separate different parts of the site’s CSS into different files.
You also want to keep the CSS and JavaScript in different files while you develop, to make debugging easier.
django-compress is an asset packaging library for Django, providing
both CSS and JavaScript concatenation and compression, built-in JavaScript
template support, and optional data-URI image and font embedding.
It is also nice to comment CSS and JavaScript, but you do not want the overhead
of sending the comments and whitespaces to the clients.
You also want to make sure that as much of the static content is cached as much
as possible at the client.
The ideal is to even avoid “304 Not Modified” which are returned when a client
requested something that has already been cached, and does not need to be updated.
This can be accomplished by setting the HTTP Expire header to a date far in the future.
That will force the browser not to ask for updates for that URL.
However, when you need to update your files, you will need to give them a new URL,
to push the updated files to the clients.
These techniques has been described more in depth at Yahoo:
* http://developer.yahoo.com/performance/rules.html#num_http
* http://developer.yahoo.com/performance/rules.html#minify
* http://developer.yahoo.com/performance/rules.html#expires
django-compress tries to address those issues with as little manual intervention
as possible, whilst still being configurable enough to not get in your way.
Read more about the :doc:`features`.
There are numerous of other techniques that could be used to improve performance,
Yahoo has an excellent page that lists the most common: http://developer.yahoo.com/performance/rules.html
You can report bugs and discuss features on the `issues page <https://github.com/cyberdelia/django-compress/issues>`_.
Table Of Contents
=================
...
...
@@ -43,13 +18,12 @@ Table Of Contents
.. toctree::
:maxdepth: 2
features
installation
usage
configuration
versioning
usage
compressors
compilers
versioning
farfutureexpires
backwardsincompatiblechanges
...
...
docs/installation.rst
View file @
f420dae8
...
...
@@ -4,18 +4,16 @@
Installation
============
Installation is pretty straight-forward and follows the same installation
procedure as many other *Django* applications.
1. Either check out django-compress from GitHub_ or to pull a release off PyPI_ ::
``django-compress`` does not create any models, so you do not need to configure a database.
pip install django-compress
Install instructions
====================
1. Either check out django-compress from GitHub_ or to pull a release off PyPI_.
Doing ``pip install django-compress`` or ``easy_install django-compress`` is all that should be required.
2. Add 'compress' to your ``INSTALLED_APPS`` ::
2. Add 'compress' to your ``INSTALLED_APPS``
INSTALLED_APPS = (
'compress',
)
.. _GitHub: http://github.com/pelme/django-compress
...
...
docs/usage.rst
View file @
f420dae8
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment