django-pipeline


Namedjango-pipeline JSON
Version 4.0.0 PyPI version JSON
download
home_pageNone
SummaryPipeline is an asset packaging library for Django.
upload_time2024-12-06 12:11:11
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords django pipeline asset compiling concatenation compression packaging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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>`_.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "django-pipeline",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "django, pipeline, asset, compiling, concatenation, compression, packaging",
    "author": null,
    "author_email": "Timoth\u00e9e Peignier <timothee.peignier@tryphon.org>",
    "download_url": "https://files.pythonhosted.org/packages/49/f5/12c83c33f0d6cd93a7b1498a1b3ae9bd86828f1f739998f59c5249d7504e/django_pipeline-4.0.0.tar.gz",
    "platform": null,
    "description": "Pipeline\n========\n\n.. image:: https://jazzband.co/static/img/badge.svg\n    :alt: Jazzband\n    :target: https://jazzband.co/\n\n.. image:: https://github.com/jazzband/django-pipeline/workflows/Test/badge.svg\n   :target: https://github.com/jazzband/django-pipeline/actions\n   :alt: GitHub Actions\n\n.. image:: https://codecov.io/gh/jazzband/django-pipeline/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/jazzband/django-pipeline\n   :alt: Coverage\n\n.. image:: https://readthedocs.org/projects/django-pipeline/badge/?version=latest\n    :alt: Documentation Status\n    :target: https://django-pipeline.readthedocs.io/en/latest/?badge=latest\n\n\nPipeline is an asset packaging library for Django, providing both CSS and\nJavaScript concatenation and compression, built-in JavaScript template support,\nand optional data-URI image and font embedding.\n\n.. image:: https://github.com/jazzband/django-pipeline/raw/master/img/django-pipeline.svg\n   :alt: Django Pipeline Overview\n\n\nInstallation\n------------\n\nTo install it, simply:\n\n.. code-block:: bash\n\n    pip install django-pipeline\n\n\nQuickstart\n----------\n\nPipeline compiles and compress your assets files from\n``STATICFILES_DIRS`` to your ``STATIC_ROOT`` when you run Django's\n``collectstatic`` command.\n\nThese simple steps add Pipeline to your project to compile multiple ``.js`` and\n``.css`` file into one and compress them.\n\nAdd Pipeline to your installed apps:\n\n.. code-block:: python\n\n    # settings.py\n    INSTALLED_APPS = [\n        ...\n        'pipeline',\n    ]\n\n\nUse Pipeline specified classes for ``STATICFILES_FINDERS`` and ``STATICFILES_STORAGE``:\n\n.. code-block:: python\n\n    STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'\n\n    STATICFILES_FINDERS = (\n        'django.contrib.staticfiles.finders.FileSystemFinder',\n        'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n        'pipeline.finders.PipelineFinder',\n    )\n\n\nConfigure Pipeline:\n\n.. code-block:: python\n\n    # The folowing config merges CSS files(main.css, normalize.css)\n    # and JavaScript files(app.js, script.js) and compress them using\n    # `yuglify` into `css/styles.css` and `js/main.js`\n    # NOTE: Pipeline only works when DEBUG is False\n    PIPELINE = {\n        'STYLESHEETS': {\n            'css_files': {\n                'source_filenames': (\n                    'css/main.css',\n                    'css/normalize.css',\n                ),\n                'output_filename': 'css/styles.css',\n                'extra_context': {\n                    'media': 'screen,projection',\n                },\n            },\n        },\n        'JAVASCRIPT': {\n            'js_files': {\n                'source_filenames': (\n                    'js/app.js',\n                    'js/script.js',\n                ),\n                'output_filename': 'js/main.js',\n            }\n        }\n    }\n\n\nThen, you have to install compilers and compressors binary manually.\n\nFor example, you can install them using `NPM <https://www.npmjs.com/>`_\nand address them from ``node_modules`` directory in your project path:\n\n.. code-block:: python\n\n    PIPELINE.update({\n        'YUGLIFY_BINARY': path.join(BASE_DIR, 'node_modules/.bin/yuglify'),\n    })\n    # For a list of all supported compilers and compressors see documentation\n\n\nLoad static files in your template:\n\n.. code-block::\n\n    {% load pipeline %}\n    {% stylesheet 'css_files' %}\n    {% javascript 'js_files' %}\n\n\nDocumentation\n-------------\n\nFor documentation, usage, and examples, see:\nhttps://django-pipeline.readthedocs.io\n\n\nIssues\n------\nYou can report bugs and discuss features on the `issues page <https://github.com/jazzband/django-pipeline/issues>`_.\n\n\nChangelog\n---------\n\nSee `HISTORY.rst <https://github.com/jazzband/django-pipeline/blob/master/HISTORY.rst>`_.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Pipeline is an asset packaging library for Django.",
    "version": "4.0.0",
    "project_urls": {
        "changelog": "https://github.com/jazzband/django-pipeline/blob/master/HISTORY.rst",
        "documentation": "https://django-pipeline.readthedocs.io/",
        "homepage": "https://github.com/jazzband/django-pipeline/",
        "repository": "https://github.com/jazzband/django-pipeline"
    },
    "split_keywords": [
        "django",
        " pipeline",
        " asset",
        " compiling",
        " concatenation",
        " compression",
        " packaging"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2d057258f4b27839d186dfc29f9416475d236c2a64f25ff64a22e77d700eb753",
                "md5": "04805cda24139fcb13068dfe52b8fdb2",
                "sha256": "90e50c15387a6e051ee1a6ce2aaca333823ccfb23695028790f74412bde7d7db"
            },
            "downloads": -1,
            "filename": "django_pipeline-4.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "04805cda24139fcb13068dfe52b8fdb2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 75384,
            "upload_time": "2024-12-06T12:10:08",
            "upload_time_iso_8601": "2024-12-06T12:10:08.162963Z",
            "url": "https://files.pythonhosted.org/packages/2d/05/7258f4b27839d186dfc29f9416475d236c2a64f25ff64a22e77d700eb753/django_pipeline-4.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "49f512c83c33f0d6cd93a7b1498a1b3ae9bd86828f1f739998f59c5249d7504e",
                "md5": "221e44d34b402898b6e7b858b786e0ef",
                "sha256": "0ab1190d9dc64e2f7b72be3f7b023c06aca7cc1cc61e7dc9f0343838e29bbc88"
            },
            "downloads": -1,
            "filename": "django_pipeline-4.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "221e44d34b402898b6e7b858b786e0ef",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 71780,
            "upload_time": "2024-12-06T12:11:11",
            "upload_time_iso_8601": "2024-12-06T12:11:11.795056Z",
            "url": "https://files.pythonhosted.org/packages/49/f5/12c83c33f0d6cd93a7b1498a1b3ae9bd86828f1f739998f59c5249d7504e/django_pipeline-4.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-06 12:11:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jazzband",
    "github_project": "django-pipeline",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "django-pipeline"
}
        
Elapsed time: 1.52864s