Skip to main content

Vue JS Reverse

Project description

VUE JS Reverse

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..

You can retrieve a named url:

urls.py:

path('company/update/company_id/<int:company_id>/', main.update_company, name='update_company')

in javascript like:

this.$urls.update_company(12)

Result:

company/update/company_id/12/

Requirements

python 3.6+

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.githubusercontent.com/miklagard/vue-js-reverse/master/LICENSE

Contact

cem.yildiz@ya.ru


Enjoy!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vue_js_reverse-0.0.8-py2.py3-none-any.whl (20.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file vue_js_reverse-0.0.8-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for vue_js_reverse-0.0.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4d2507a4ba371a658f2e26c8739ac432c244fa986418e764f6f25e638781cc5b
MD5 3bf9242afb827f10e41404dd7456b538
BLAKE2b-256 faef6717822aa139d4ba2f8f2d56f843235abda0b16aa64f16edf3a9570efe53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page