Q:

Menu in Django

Hi I start to learn Django. 
I have a simple menu-list
{% block menu %} 
    <ul>
    {% for item in list %}
    <li><a href="{{item}}/">{{ item }}</a></li>
    {% endfor %}
    </ul>
{% endblock %}

and a list f.ex. 
MENU = ['Home','Contact','About']

When I press Contact then go to the address  127.0.0.1:8000/Contact
with this same template but if I again click Contact I'm getting Page not found at 127.0.0.1:8000/Contact/Contact
What can I do about this? 
Sorry for my English. 

A:

The particular issue here is that the HTML you emit has links to "Contact/", which if you're already at a /Contact URL, will go to a /Contact/Contact like you see here. 
The quick fix is to add a / right before the {{item}}, like this:
<li><a href="/{{item}}/">{{ item }}</a></li>

However, django has better ways to handle URLs than creating them yourself.   Look at the URL dispatcher documentation [1], with the intention of being able to use the url template tag [2]. 
What that line would end up looking like then is something like this:
<li><a href="{% url item %}">{{ item }}</a></li>

[1] http://docs.djangoproject.com/en/dev/topics/http/urls/
[2] http://docs.djangoproject.com/en/1.2/ref/templates/builtins/#url

