python - How can I extend a tornado template from a parent template by giving a path starting from template_path? -


I have set the template_path configuration variable in my template from the template folder.

I have the following template in this folder: to expand register.html

  base.html admin / register.html   

I want Base.html so I have:

  expand {% "base.html"%}   

This causes the following error:

  IOError: [Aron 2] There is no such file or directory: '/ home / kj / lab / test / templates / Admin / base.html '  

Obviously this is looking at the same directory with a child template. Of course I can get base.html from ../bas.html but I think it is better if I can give it the "full path" (in the sense of starting with template_path)

Can anyone help?

The way render works, I do not think it is possible is. When you give the name of the template to render the function, such as:

  RequestHandler.render ('admin / register.html')   

< The template will start looking for a template from template_path / admin> to extended which is a operator , code Find the template in the admin directory, so you have to give relative path if I get something else, then I will update this answer

edit : I Confirmed that it is no longer possible and it has been added by Ben Durnell as Tornado Issues Tracker (he maintains Tornado Project).

Comments

Popular posts from this blog

Out of index C/C++ -

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

java - Projects which are accessed via multiple (different) IDEs: Ant or Maven? -