Drop-in replacement for staticfiles which handles asset processing.
Project description
Django Assetfiles
=================
Django Assetfiles is a drop-in replacement for staticfiles which handles asset processing.
Installation
------------
1. Install package from PyPi:
``` sh
$ pip install django-assetfiles
```
2. Replace `'django.contrib.staticfiles'` in `INSTALLED_APPS` with `'assetfiles'`:
``` python
INSTALLED_APPS = (
# ...
# 'django.contrib.staticfiles',
'assetfiles',
)
```
3. That's it! Assetfiles will default to your [Staticfiles settings](https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/).
Usage
-----
1. Add an asset file that should be processed:
``` scss
// static/css/main.scss
$color: red;
body {
color: $color;
}
```
2. Add a link to the processed CSS file in your template (you can use standard Staticfiles conventions):
``` html+django
{% load staticfiles %}
<link href="{% static 'css/main.css' %}" rel="stylesheet">
```
Assetfiles will automatically serve up the processed version of `main.scss` at the static url of `/static/css/main.css`.
3. For deployment, run `collectstatic` as usual and Assetfiles will process and copy over the assets:
``` sh
$ python manage.py collectstatic
$ cat public/css/main.css
body {
color: red; }
```
Copyright
---------
Copyright (c) 2012 [LocalMed, Inc.](http://localmed.com). See LICENSE for details.
=================
Django Assetfiles is a drop-in replacement for staticfiles which handles asset processing.
Installation
------------
1. Install package from PyPi:
``` sh
$ pip install django-assetfiles
```
2. Replace `'django.contrib.staticfiles'` in `INSTALLED_APPS` with `'assetfiles'`:
``` python
INSTALLED_APPS = (
# ...
# 'django.contrib.staticfiles',
'assetfiles',
)
```
3. That's it! Assetfiles will default to your [Staticfiles settings](https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/).
Usage
-----
1. Add an asset file that should be processed:
``` scss
// static/css/main.scss
$color: red;
body {
color: $color;
}
```
2. Add a link to the processed CSS file in your template (you can use standard Staticfiles conventions):
``` html+django
{% load staticfiles %}
<link href="{% static 'css/main.css' %}" rel="stylesheet">
```
Assetfiles will automatically serve up the processed version of `main.scss` at the static url of `/static/css/main.css`.
3. For deployment, run `collectstatic` as usual and Assetfiles will process and copy over the assets:
``` sh
$ python manage.py collectstatic
$ cat public/css/main.css
body {
color: red; }
```
Copyright
---------
Copyright (c) 2012 [LocalMed, Inc.](http://localmed.com). See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-assetfiles-0.1.0.tar.gz
(11.9 kB
view hashes)
Built Distribution
django_assetfiles-0.1.0-py2.7.egg
(42.4 kB
view hashes)
Close
Hashes for django_assetfiles-0.1.0-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0178d4c99d2636ecf55f456ced8b6da88f84496966f392d2deede4b9748bfc6 |
|
MD5 | e44c6fb75d0f83dd9886f69342505e24 |
|
BLAKE2b-256 | 38e07c13f011d9da784a0587a565a9c2fe30b98822d7d9c08437cf4df3123a1b |