Django flatpages will show only one page

I'm trying to use flatpages in my Django application. I installed it properly as far as I can see and created 2 pages. Using the shell, when I try:

>>> from django.contrib.flatpages.models import FlatPage
>>> FlatPage.objects.all()
<QuerySet [<FlatPage: /pages/en-US/about/privacy/ -- Privacy Policy>, <FlatPage: /pages/fr-FR/about/privacy/ -- Politique de Confidentialité>]>

I can see my 2 pages. But in a template, I'm using:

{% get_flatpages as about_pages %}
{% for page in about_pages %}
    <a class="navbar-item" href="{{ page.url }}">{{ page.title }}</a>
{% endfor %}

And there I can see only the last page. Also when I access directly the first page using it's full URL ( it displays nicely but when I try the same with the other one ( I get a 404.

I tried to change the name of the first page, but nothing works. Any idea???

I found the issue. The other pages were not linked to the site with ID 1. The Admin interface for creating flat pages is quite ugly when it comes to linking them to sites. In my form, I had all the 3 sites linked to all pages but looking at the database, it was wrong so many a bug in the admin page...

Back to Top