django-js-utils

  93 downloads
0.0.5 BSD License    
  not rated
Django app to help RIA development on top of a Django backend

description

download

specifications

django-js-utils is a Django app that aims to offer Django/JavaScript developers with various tools which will help RIA development on top of a Django backend.

Installation and usage

- Add django_js_utils to your python path and add the django_js_utils application to your INSTALLED_APPS
- Add the jsurls view to your URL patterns, e.g.,

(r'^jsurls.js$', 'django_js_utils.views.jsurls', {}, 'jsurls'),

- Load the static django_js_utils.js (which contains the reverse function) and the dynamically-generated jsurls.js from every web page where you plan to use the reverse function (likely just your base.html template). Example:

< script type="text/javascript" src="{% staticfile 'django_js_utils.js' %}" >< /script >
< script type="text/javascript" src="{% url jsurls %}" >< /script >


- In your JavaScript code, reverse URLs as follows:

django_js_utils.urls.resolve('dashboard')
django_js_utils.urls.resolve('time_edit', { project_id: 1, time_id: 2 })


For more information about usage, see example.html
READ MORE   
Last updated on September 10th, 2012

0 User reviews so far.

SUBMIT