views:

215

answers:

1

I'm developing software on google app engine. I'm using the webapp framework. is there any way to avoid hard-coding urls in the html templates? django provides a solution, but I couldn't find one for webapp. thanks in advance..

+1  A: 

WebApp is really very basic.

Django url templatetag is closely tied to its idea of URL resolving by matching regex patterns. As WebApp does not have any serious URL resolver, I imagine this would be really hard task to implement something in this line.

But you are not totally out of luck. Werkzeug has very easy to understand yet powerful URL routing mechanism that allows for reversing urls. You can try to base your implementation on this one (or throw away WebApp and use Werkzeug ;), it's really worth a try).

zgoda
werkzeug has evolved into a really neat package indeed, if you want to code your web apps at lower levels or with more flexibility than Django affords. WELL worth looking into!
Alex Martelli