Hi there,
I have a simple request handler that is supposed to take a URL and map
it to template files where/when they exist [see #1, below] and it
works *except* where I have a template inside a folder (/templates/
folder/thisone.html) that inherits from a template in its parent /
templates/ folder (/templates/base.html).

So when I navigate to myurl.com/folder/thisone.html (which starts with
{% extends 'base.html' %} or {% extends '../base.html' %}) I see the
results shown in [#2].

Navigating to myurl.com/folder/atemplate.html does work if it is not
tryiing to extend 'base.html'.

Any ideas?

Thanks,

Matt

[#1] request handler
class MainPage(webapp.RequestHandler):
  def get(self):
    if self.request.path == "/":
      thistemplate = "index.html"
    else:
      thistemplate = self.request.path
    template_values = []
    template_path = 'templates' + thistemplate
    path = os.path.join(os.path.dirname(__file__), template_path)
    try:
      self.response.out.write(template.render(path, template_values))
    except:
      self.response.out.write('Page does not exist... sorry! <br />
Your path: '+str(self.request.path)+'<br />Template path:
'+str(template_path))

[#2] results of navigating to myurl.com/folder/thisone.html

Page does not exist... sorry! path: /folder/thisone.html
Template path: templates/folder/thisone.html
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to