can anyone help me in developing a simple webpage in jinja2

Jan Riechers janpeterr at freenet.de
Sat Apr 6 03:15:19 EDT 2013


On 06.04.2013 01:41, Satabdi Mukherjee wrote:
> i am a rookie in python and i am trying to develop a simple webpage using jinja2.
can anyone please help me how to do that
> i am trying in this way but showing invalid syntax error
>
[...]
>      <ul id="navigation">
>      {% for item in navigation %}
>          <li><a href="{{ item.href }}">{{ item.caption }}</a></li>
>      {% endfor %}
>      </ul>
>
>      <h1>My Webpage</h1>
>      {{ a_variable }}
[...]
>

Hello,

the jinja2 syntax is correct that way, see also this for reference for 
variable naming:
http://jinja.pocoo.org/docs/templates/index.html#variables

The invalid syntax is raised when? Can you post the error a bit more 
detailed, this will help giving you any advice.

If you know the code part raising the error and you post it, this will 
also help.

Jan



More information about the Python-list mailing list