Skip to content

Commit 56ce02d

Browse files
committed
Doc fixes
1 parent d5d4d65 commit 56ce02d

File tree

4 files changed

+48
-21
lines changed

4 files changed

+48
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ MANIFEST
99
*.egg
1010
docs/_build/
1111
.sass-cache
12+
.coverage

docs/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Contents
3737

3838
quickstart
3939
usage
40+
scenarios
4041
settings
4142
remote-storages
4243
behind-the-scenes

docs/scenarios.txt

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,65 @@
33
Common Deployment Scenarios
44
===========================
55

6-
This document presents the most typical scenarios in which Django Compressor can be
7-
configured, and should help you decide which method you may want to use for your stack.
6+
This document presents the most typical scenarios in which Django Compressor
7+
can be configured, and should help you decide which method you may want to
8+
use for your stack.
89

910
In-Request Compression
10-
--------
11+
----------------------
1112

12-
This is the default method of compression. Where-in Django Compressor will go through
13-
the steps outlined in :ref:`behind_the_scenes`. You will find in-request compression beneficial if:
13+
This is the default method of compression. Where-in Django Compressor will
14+
go through the steps outlined in :ref:`behind_the_scenes`. You will find
15+
in-request compression beneficial if:
1416

15-
* Using a single server setup, where the application and static files are on the same machine.
17+
* Using a single server setup, where the application and static files are on
18+
the same machine.
1619

17-
* Prefer a simple configuration. By default, there is no configuration required.
20+
* Prefer a simple configuration. By default, there is no configuration
21+
required.
1822

1923
Caveats
20-
----
24+
-------
2125

22-
* If deploying to a multi-server setup and using :attr:`~django.conf.settings.COMPRESS_PRECOMPILERS`, each binary is required to be installed on each application server.
26+
* If deploying to a multi-server setup and using
27+
:attr:`~django.conf.settings.COMPRESS_PRECOMPILERS`, each binary is
28+
required to be installed on each application server.
2329

24-
* Application servers may not have permissions to write to your static directories. For example, if deploying to a CDN (e.g. Amazon S3)
30+
* Application servers may not have permissions to write to your static
31+
directories. For example, if deploying to a CDN (e.g. Amazon S3)
2532

2633
Offline Compression
27-
--------
34+
-------------------
2835

29-
This method decouples the compression outside of the request (see :ref:`behind_the_Scenes`) and can prove beneficial in the speed, and in many scenarios, the maintainability of your deployment. You will find offline compression beneficial if:
36+
This method decouples the compression outside of the request
37+
(see :ref:`behind_the_Scenes`) and can prove beneficial in the speed,
38+
and in many scenarios, the maintainability of your deployment.
39+
You will find offline compression beneficial if:
3040

31-
* Using a multi-server setup. A common scenario for this may be multiple application servers and a single static file server (CDN included). With offline compression, you typically run ``manage.py compress`` on a single utility server, meaning you only maintain :attr:`~django.conf.settings.COMPRESS_PRECOMPILERS` binaries in one location.
41+
* Using a multi-server setup. A common scenario for this may be multiple
42+
application servers and a single static file server (CDN included).
43+
With offline compression, you typically run ``manage.py compress``
44+
on a single utility server, meaning you only maintain
45+
:attr:`~django.conf.settings.COMPRESS_PRECOMPILERS` binaries in one
46+
location.
3247

3348
* You store compressed files on a CDN.
3449

3550
Caveats
36-
----
37-
38-
* If your templates have complex logic in how template inheritance is done (e.g. ``{% extends context_variable %}``), then this becomes a problem, as offline compression will not have the context, unless you set it in :attr:`~django.conf.settings.COMPRESS_OFFLINE_CONTEXT`
39-
40-
* Due to the way the manifest file is used, While deploying across a multi-server setup, your application may use old templates with a new manifest, possibly rendering your pages incoherent. The current suggested solution for this is to change the :attr:`~django.conf.settings.COMPRESS_OFFLINE_MANIFEST` path for each new version of your code. This will ensure that the old code uses old compressed output, and the new one appropriately as well.
41-
42-
Every setup is unique, and your scenario may differ slightly. Choose what is the most sane to maintain for your situation.
51+
-------
52+
53+
* If your templates have complex logic in how template inheritance is done
54+
(e.g. ``{% extends context_variable %}``), then this becomes a problem,
55+
as offline compression will not have the context, unless you set it in
56+
:attr:`~django.conf.settings.COMPRESS_OFFLINE_CONTEXT`
57+
58+
* Due to the way the manifest file is used, while deploying across a
59+
multi-server setup, your application may use old templates with a new
60+
manifest, possibly rendering your pages incoherent. The current suggested
61+
solution for this is to change the
62+
:attr:`~django.conf.settings.COMPRESS_OFFLINE_MANIFEST` path for each new
63+
version of your code. This will ensure that the old code uses old
64+
compressed output, and the new one appropriately as well.
65+
66+
Every setup is unique, and your scenario may differ slightly. Choose what
67+
is the most sane to maintain for your situation.

docs/settings.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ Backend settings
238238
The lessc compiler will have different parameters if installed
239239
with Ruby Gems and not npm_.
240240

241-
_npm: http://lesscss.org/#-server-side-usage
241+
.. _npm: http://lesscss.org/#-server-side-usage
242242

243243
With that setting (and CoffeeScript_ installed), you could add the following
244244
code to your templates:

0 commit comments

Comments
 (0)