Steve Gattuso
Steve Gattuso

Reputation: 7832

Reverse URL mapping with AppEngine

I was wondering if there's a function like Django's django.core.urlresolvers.reverse for Google's App Engine. I've been searching everywhere but haven't been able to find anything about it.

Thanks in advance

Upvotes: 3

Views: 673

Answers (3)

jsdalton
jsdalton

Reputation: 6845

If you use webapp2, "a lightweight Python web framework compatible with Google App Engine’s webapp," you can take advantage of their URI routing features, which include a function uri_for() that does reverse routing akin to Django's reverse().

webapp2 is essentially a superset of webapp, so it's trivial to drop in as a replacement. It's a pretty sweet little library.

Upvotes: 4

Cody Hess
Cody Hess

Reputation: 1796

After a hard search, I found confusing documentation for similar functionality in Google App Engine's default webapp.WSGIApplication class. It seems as though regular expressions can be passed to a Handler, but they're named and used by giving extra arguments to that handler's get function.

Upvotes: 2

Nick Johnson
Nick Johnson

Reputation: 101149

This isn't really anything App Engine specific - if you're using App Engine Patch, you can use Django, including its URL resolvers. Alternately, you can use any other framework with a reverse resolver, or use one on its own.

Upvotes: 2

Related Questions