Answer the question
In order to leave comments, you need to log in
How are links defined in Django?
There is such a html navigation (so far only layout)
<ul class="nav navbar-nav">
<li class="active"><a href="index">Главная<span class="sr-only">(current)</span></a></li>
<li class="dropdown">
<a href="blog" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">О нас<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="about.html">О нас</a></li>
<li><a href="photo.html">Фото</a></li>
<li><a href="blog">Блог</a></li>
</ul>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Цены <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Прайс-лист</a></li>
<li><a href="#">Наши услуги</a></li>
</ul>
</li>
<li><a href="contacts.html">Контакты</a></li>
</ul>
Answer the question
In order to leave comments, you need to log in
The MVT methodology assumes the maximum separation of the
Template entities only shows, then it orders to show the View, which in turn takes data from the Model.
You need to write the View resolving rules in urls.py
# ....
url(r'^$', index_view, name='index'),
# ...
def index_view(request):
return render(request, 'index.html')
...
<a href="{% url "index" %}">
...
Django has nothing to do with it, just specify addresses starting with /: /index
and so on.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question