Utilities and helpers for integrating Django + Vue
Project description
Provides helpers and utilities for integrating with a Vue front-end, as described in Cookiecutter Vue + Django
Quick start
Add dependency django-vue-utils
Add “django_vue_utilities” to your INSTALLED_APPS setting:
Settings
Tailor the following settings to your Vue front-end. The defaults are provided below.
VUE_FRONTEND_USE_TYPESCRIPT = False
VUE_FRONTEND_USE_DEV_SERVER = settings.DEBUG
VUE_FRONTEND_DEV_SERVER_URL = 'http://localhost:5173'
VUE_FRONTEND_DEV_SERVER_PATH = 'src'
VUE_FRONTEND_STATIC_PATH = 'vue'
Usage
{% extends "base.html" %}
{% load vue_utils %}
{% block extra_js %}
{# Import entrypoint JavaScript, choosing dev or static source depending on settings #}
<script type="module" crossorigin src="{% vue_bundle_url 'my_vue_entrypoint' %}"></script>
{# 'provide" strings which can 'injected' throughout the Vue app, including from within a pinia store #}
{% url 'home' as homeUrl %}
{% vue_provide 'homeUrl' homeUrl %}
{% endblock %}
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-vue-utils-0.1.5.tar.gz
(2.8 MB
view hashes)
Built Distribution
Close
Hashes for django_vue_utils-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0eed122b038fe4dd383871e10b9f1b938a6a16d3b96a9365beb5b0151516dfae |
|
MD5 | 8fd96b97489d2f562c5839cd6b03b61b |
|
BLAKE2b-256 | 45f8e4e8a8f3101094bd1810b53ccaebf87792fec568f4655edb711ec30d8c31 |