DRY URL's in Django Javascript
Posted
by Noio
on Stack Overflow
See other posts from Stack Overflow
or by Noio
Published on 2010-04-27T19:30:58Z
Indexed on
2010/04/27
19:33 UTC
Read the original article
Hit count: 399
I'm using Django on Appengine. I'm using the django reverse()
function everywhere, keeping everything as DRY as possible.
However, I'm having trouble applying this to my client-side javascript. There is a JS class that loads some data depending on a passed-in ID. Is there a standard way to not-hardcode the URL that this data should come from?
var rq = new Request.HTML({
'update':this.element,
}).get('/template/'+template_id+'/preview'); //The part that bothers me.
© Stack Overflow or respective owner