=================
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`.
4. To serve assets in development, either use `runserver` as normal or add the following to your `urls.py`:
``` python
from assetfiles.urls import assetfiles_urlpatterns
# ... the rest of your URLconf goes here ...
urlpatterns += assetfiles_urlpatterns()
```
5. 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.
Metadata
Release files for django-assetfiles 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-assetfiles-0.8.0.tar.gz | 17.3 kB | Without provenance | Details for django-assetfiles-0.8.0.tar.gz |
Release files / django-assetfiles-0.8.0.tar.gz
| Download URL | django-assetfiles-0.8.0.tar.gz |
|---|---|
| Size | 17.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b70337b9d6c4fae053e256f7fb3f03527d3aa4e6f5365518ea24951edbd53d8e
|
|
BLAKE2b-256 checksum How to use checksums |
70dd07a6411aa3d4861f199e279806662258367b13afd5000419a731332b3e8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-assetfiles 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.