Skip to content

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

use 'reverse' from javascript

Resources

Stars

11 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages