Answer the question
In order to leave comments, you need to log in
How to correctly display the default URL of the language in Django 2.2?
I want to correctly display the list of URLs on the language versions of the page, and I have more than 10 of them. I have
English by default and should always open at the site.com/ URL without /en/ at the end
. I display the list through a loop
{% for language in languages %}
<a class="col-3" href="/{{ language.code }}/" lang="{{ language.code }}">{{ language.name_local }}</a>
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question