Skip to main content

Asset manager.

Project description

Features

  • Pure Python asset manager
  • Python 3 support

Installation

pip install django-easyasset

Configuration

settings.py

INSTALLED_APPS = (
    ...
    'django.contrib.staticfiles',
    'easyasset',
    ...
)

# it is used by "manage.py collectstatic"
STATICFILES_FINDERS = (
    ...
    'easyasset.finders.EasyAssetFinder',
)

EASYASSET_RULES = {
    'css/all.css': {
        'sources': [
            'components/*.css',
            'blocks/*/*.css',
        ],
        'ignore': [
            'blocks/*/*.ie*.css',
        ],
    },
    'css/ie8.css': {
        'sources': [
            'blocks/*/*.ie8.css',
        ],
    },
    'js/all.js': {
        'sources': [
            'blocks/*/*.js',
        ]
    }
}

# if you would like to minify css and js files
EASYASSET_COMPRESS = True

urls.py

from django.conf.urls.static import static
from easyasset.views import easyasset_static_serve

urlpatterns = patterns('',
    # your urls
)
# add static url with argument view=easyasset_static_serve
urlpatterns += static(settings.STATIC_URL, view=easyasset_static_serve)

templates

{% load staticfiles %}

<link rel="stylesheet" href="{% static 'css/all.css' %}">
<script src="{% static 'js/all.js' %}"></script>

Runserver

manage.py runserver --nostatic

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-easyasset-0.0.6.tar.gz (3.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page