Skip to main content

Assets management for django

Project description

Install

pip install django-assets-manager

Usage

Settings

INSTALLED_APPS = (
        # ...
        'django_assets_manager',
)

STATICFILES_FINDERS = (
        'django.contrib.staticfiles.finders.FileSystemFinder',
        'django.contrib.staticfiles.finders.AppDirectoriesFinder',
        'django_assets_manager.finders.CdnFinder',
)

ASSETS_MANAGER_FILES = {
        "utils": {
                "js": "static://js/utils.js",
        },
        "cooleffect": {
                "js": ["static://js/cooleffect.js"],
                "css": ["static://css/cooleffect.css"],
                "depends": ["utils", "jquery"],
        },
        "jquery": {
                "js": "//code.jquery.com/jquery-2.1.4.min.js",
                "cache": {
                        "paths": {
                                "//code.jquery.com/jquery-2.1.4.min.js": "jquery-2.1.4.min.js",
                        }
                },
        },
}

ASSETS_MANAGER_SPRITES = (
        {
                'name': 'main',
                'output': 'images/sprites.png',
                'scss_output': 'css/_sprites.scss',
                'extra_sizes': ((2, '@2x'),),
                'width': 640,
                'height': 640,
                'images': (
                        {
                                'name': 'logo',
                                'src': 'img/logo.png',
                        },
                        {
                                'name': 'bar_bg',
                                'src': 'img/bar_bg.png',
                                'mode': 'repeat-x',
                        },
                ),
        },
)

Template

{% load assets_manager %}
{% assets "cooleffect" %}
<!-- or -->
{% assets_css "cooleffect" %}
{% assets_js "cooleffect" %}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_assets_manager-1.0.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_assets_manager-1.0.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file django_assets_manager-1.0.0.tar.gz.

File metadata

  • Download URL: django_assets_manager-1.0.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.10

File hashes

Hashes for django_assets_manager-1.0.0.tar.gz
Algorithm Hash digest
SHA256 87ed987a2d3a1a8c7e72754937b725681b57492bae0d034c937e3341d0427b99
MD5 f108b0fc86ddaac06fe8d2e46de84424
BLAKE2b-256 ed40bfb7396d3f89ff89784567a55a7276cc120b55840c53bfeaa6b51b8fe49e

See more details on using hashes here.

File details

Details for the file django_assets_manager-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_assets_manager-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 992ac1a250a44da108f7cf98d3f2ac954409504f0aed346cf864767b61912e76
MD5 aaf33240fe63cae7c15a61208e628a2d
BLAKE2b-256 15d20a57642351f55cc7cf27067a4ff7235588c97f17f9f21cf036067c49b3cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page