Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

use 'reverse' from javascript

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 jsroutes
Octocat-spinner-32 testproject
Octocat-spinner-32 .gitignore
Octocat-spinner-32 MANIFEST.in
Octocat-spinner-32 README.md
Octocat-spinner-32 buildenv.sh
Octocat-spinner-32 setup.py
Octocat-spinner-32 test.sh
README.md

jsroutes

use django's reverse function from javascript

Requirements

nothing

Usage

there are two ways of using jsroutes

1st

  • add "jsroutes" to INSTALLED_APPS
  • add url("^someprefix/", include("jsroutes.urls")) to your urlconf
  • include <script type="text/javascript" src="{% url jsroutes %}"></script> in your templates

2nd

  • add "jsroutes" to INSTALLED_APPS
  • call manage.py generate_jsroutes somefilename.js
  • include <script type="text/javascript" src="{{ STATIC_URL }}somefilename.js"></script> in your templates

after it you can call django_url_reverse(name, args) from javascript

Something went wrong with that request. Please try again.