Vue JS Reverse
Project description
================= VUE JS Reverse
.. image:: https://img.shields.io/pypi/v/vue-js-reverse.svg :target: https://pypi.python.org/pypi/vue-js-reverse/
.. image:: https://img.shields.io/travis/ierror/django-js-reverse/master.svg :target: https://travis-ci.org/ierror/vue-js-reverse
.. image:: https://img.shields.io/coveralls/ierror/django-js-reverse/master.svg :alt: Coverage Status :target: https://coveralls.io/r/ierror/django-js-reverse?branch=master
.. image:: https://img.shields.io/github/license/ierror/django-js-reverse.svg :target: https://raw.githubusercontent.com/ierror/django-js-reverse/master/LICENSE
.. image:: https://img.shields.io/pypi/wheel/django-js-reverse.svg
Vue url handling for Django that doesn’t hurt.
Overview
Django Vue Reverse (a fork of Django Js Reverse) is a small django app that makes url handling of
named urls <https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns>__ in javascript easy and non-annoying..
For example you can retrieve a named url:
urls.py:
::
url(r'^/betterliving/(?P<category_slug>[-\w]+)/(?P<entry_pk>\d+)/$', 'get_house', name='betterliving_get_house'),
in javascript like:
::
this.$urls.betterlivingGetHouse('house', 12)
Result:
::
/betterliving/house/12/
Requirements
+----------------+------------------------------------------+ | Python version | Django versions | +================+==========================================+ | 3.7 | 2.2, 2.1, 2.0, 1.11, 1.10, 1.9, 1.8 | +----------------+------------------------------------------+ | 3.6 | 2.2, 2.1, 2.0, 1.11, 1.10, 1.9, 1.8 | +----------------+------------------------------------------+ | 3.5 | 2.2, 2.1, 2.0, 1.11, 1.10, 1.9, 1.8 | +----------------+------------------------------------------+ | 3.4 | 2.0, 1.11, 1.10, 1.9, 1.8, 1.7, 1.6, 1.5 | +----------------+------------------------------------------+ | 2.7 | 1.11, 1.10, 1.9, 1.8, 1.7, 1.6, 1.5 | +----------------+------------------------------------------+
Installation
Install using pip …
::
pip install vue-js-reverse
… or clone the project from github.
::
git clone https://github.com/miklagard/vue-js-reverse
Add 'vue_js_reverse' to your INSTALLED_APPS setting.
::
INSTALLED_APPS = (
...
'vue_js_reverse',
)
Add library variables to settings.py file.
::
VUE_PLUGINS_DIR = os.path.join(settings.BASE_DIR, 'vue_frontend', 'src', 'plugins')
VUE_REVERSE_URL_PLUGIN = 'Urls.js'
Vue main.js
::
import Url from "@/plugins/Url"
Vue.use(Url)
Usage as static file
First generate static file by
::
./manage.py vue_js_reverse
If you change some urls or add an app and want to update the reverse.js file, run the command again.
After this add the file to your template
License
MIT <https://raw.github.com/ierror/django-js-reverse/master/LICENSE>__
Contact
@i_error <https://twitter.com/i_error>__
Enjoy!
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vue_js_reverse-0.0.1.tar.gz.
File metadata
- Download URL: vue_js_reverse-0.0.1.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7642e64300102d37ba567a977ee558cb1165e3b348d6ccd7e2a0dda5ce4d95ac
|
|
| MD5 |
9713c11cc275c1445dc55cdabfa09f98
|
|
| BLAKE2b-256 |
4fe3659acdc891e7a0f22c3afedd333cf924078d6c21dde50a1eaa8b3c33b91e
|
File details
Details for the file vue_js_reverse-0.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: vue_js_reverse-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
942a3e2ef38f6f4717c766528cee8e6ce5a10a77406604dd92e977ec3d0ca72a
|
|
| MD5 |
c0dbc63ff708a49569a46ca4504a7475
|
|
| BLAKE2b-256 |
37c54ba1d4fdde0fb055f9f311f29e0a29c1e263ed5afd592d25f5867d66a983
|