Django integration with Webpack Encore
Project description
Django Encore
This library integrates Webpack Encore into your Django application like it does Webpack Encore Bundle for Symfony.
Usage
- Install the library from PyPI:
pip install django-encore
- Configure your settings.py file:
Include the library:
INSTALLED_APPS = [
# ...
'encore',
]
Add ENCORE_ENTRYPOINTS_FILE and change STATICFILES_DIRS:
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'assets_build'),
]
ENCORE_ENTRYPOINTS_FILE = os.path.join(BASE_DIR, 'assets_build') + '/build/entrypoints.json'
- Use template tags in your templates:
{% block javascripts %}
{{ block.super }}
{% encore_entry_script_tags 'demo1' %}
{% endblock %}
{% block stylesheets %}
{{ block.super }}
{% encore_entry_link_tags 'demo1' %}
{% endblock %}
See the example folder for more 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-encore-0.0.1.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for django_encore-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9907e0a31ccb7845c6a45df9b5a30e821431e5df51e5076ad53a4786382e010a |
|
MD5 | 73f35c5ab3a1fafd3d560fec0fc32052 |
|
BLAKE2b-256 | c7c62cc5e5a6034b53a9042edc8c3f6f3b52277e14b55b0d57f670867c8a7dc6 |