Skip to content

Instantly share code, notes, and snippets.

View jackmurphy's full-sized avatar

Jack Murphy jackmurphy

  • Philadelphia, PA
View GitHub Profile
@justinvh
justinvh / urls.js
Last active August 29, 2015 13:57
Automatic JavaScript Django URL Resolver
var {{ namespace }} = {};
{{ namespace }}.urls = {{ urls }};
{{ namespace }}.resolve = function (name, kwargs) {
var path = {{ namespace }}.urls[name];
if (!path) {
throw('URL not found for view: ' + name);
}