Skip to content

barbossa/jsroutes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 81.6%
  • JavaScript 15.7%
  • Shell 2.7%