File: PKG-INFO

package info (click to toggle)
django-pipeline 4.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 904 kB
  • sloc: python: 3,170; makefile: 120; javascript: 59
file content (189 lines) | stat: -rw-r--r-- 5,786 bytes parent folder | download | duplicates (2)
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
Metadata-Version: 2.1
Name: django-pipeline
Version: 4.0.0
Summary: Pipeline is an asset packaging library for Django.
Author-email: Timothée Peignier <timothee.peignier@tryphon.org>
License: MIT
Project-URL: homepage, https://github.com/jazzband/django-pipeline/
Project-URL: documentation, https://django-pipeline.readthedocs.io/
Project-URL: repository, https://github.com/jazzband/django-pipeline
Project-URL: changelog, https://github.com/jazzband/django-pipeline/blob/master/HISTORY.rst
Keywords: django,pipeline,asset,compiling,concatenation,compression,packaging
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Utilities
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: setuptools
Requires-Dist: wheel
Provides-Extra: testing
Requires-Dist: coveralls; extra == "testing"
Requires-Dist: tox; extra == "testing"
Requires-Dist: wheel; extra == "testing"
Requires-Dist: django; extra == "testing"

Pipeline
========

.. image:: https://jazzband.co/static/img/badge.svg
    :alt: Jazzband
    :target: https://jazzband.co/

.. image:: https://github.com/jazzband/django-pipeline/workflows/Test/badge.svg
   :target: https://github.com/jazzband/django-pipeline/actions
   :alt: GitHub Actions

.. image:: https://codecov.io/gh/jazzband/django-pipeline/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/jazzband/django-pipeline
   :alt: Coverage

.. image:: https://readthedocs.org/projects/django-pipeline/badge/?version=latest
    :alt: Documentation Status
    :target: https://django-pipeline.readthedocs.io/en/latest/?badge=latest


Pipeline 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.

.. image:: https://github.com/jazzband/django-pipeline/raw/master/img/django-pipeline.svg
   :alt: Django Pipeline Overview


Installation
------------

To install it, simply:

.. code-block:: bash

    pip install django-pipeline


Quickstart
----------

Pipeline compiles and compress your assets files from
``STATICFILES_DIRS`` to your ``STATIC_ROOT`` when you run Django's
``collectstatic`` command.

These simple steps add Pipeline to your project to compile multiple ``.js`` and
``.css`` file into one and compress them.

Add Pipeline to your installed apps:

.. code-block:: python

    # settings.py
    INSTALLED_APPS = [
        ...
        'pipeline',
    ]


Use Pipeline specified classes for ``STATICFILES_FINDERS`` and ``STATICFILES_STORAGE``:

.. code-block:: python

    STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'

    STATICFILES_FINDERS = (
        'django.contrib.staticfiles.finders.FileSystemFinder',
        'django.contrib.staticfiles.finders.AppDirectoriesFinder',
        'pipeline.finders.PipelineFinder',
    )


Configure Pipeline:

.. code-block:: python

    # The folowing config merges CSS files(main.css, normalize.css)
    # and JavaScript files(app.js, script.js) and compress them using
    # `yuglify` into `css/styles.css` and `js/main.js`
    # NOTE: Pipeline only works when DEBUG is False
    PIPELINE = {
        'STYLESHEETS': {
            'css_files': {
                'source_filenames': (
                    'css/main.css',
                    'css/normalize.css',
                ),
                'output_filename': 'css/styles.css',
                'extra_context': {
                    'media': 'screen,projection',
                },
            },
        },
        'JAVASCRIPT': {
            'js_files': {
                'source_filenames': (
                    'js/app.js',
                    'js/script.js',
                ),
                'output_filename': 'js/main.js',
            }
        }
    }


Then, you have to install compilers and compressors binary manually.

For example, you can install them using `NPM <https://www.npmjs.com/>`_
and address them from ``node_modules`` directory in your project path:

.. code-block:: python

    PIPELINE.update({
        'YUGLIFY_BINARY': path.join(BASE_DIR, 'node_modules/.bin/yuglify'),
    })
    # For a list of all supported compilers and compressors see documentation


Load static files in your template:

.. code-block::

    {% load pipeline %}
    {% stylesheet 'css_files' %}
    {% javascript 'js_files' %}


Documentation
-------------

For documentation, usage, and examples, see:
https://django-pipeline.readthedocs.io


Issues
------
You can report bugs and discuss features on the `issues page <https://github.com/jazzband/django-pipeline/issues>`_.


Changelog
---------

See `HISTORY.rst <https://github.com/jazzband/django-pipeline/blob/master/HISTORY.rst>`_.