I read on the documentation page of i18n the following:
Warning
Ensure that you don’t have non-prefixed URL patterns that might collide with an automatically-dded language prefix.
I don't get this warning at all, what's the meaning of it??
I'm actually having a problem where I'm directed to my en/sitepages/news-events-listing or ar/sitepages/news-events-listing by a url defined like this in the root urls.py:
urlpatterns += i18n_patterns(
path("sitepages/", include("sitepages.urls")),
)
and I've put it before thr wagtail urls line, but the template returned by the view inside sitepages/views.py:
def sitepages_view(request):
template = loader.get_template('sitepages/news_events_page_listing.html')
context = {
'news_pages': NewsDetails.objects.all(),
'events_pages': EventsDetails.objects.all(),
'listing_page': NewsEventsListing.objects.first(),
}
return HttpResponse(template.render(context, request))
and the sitepages/urls.py:
app_name = "sitepages"
urlpatterns = [
path("news-events-listing/", sitepages_view, name='listing'),
]
I can't think of anything but this warning, and that I might need to understand it to solve the problem, although I know that the order of urls in the root urls.py matter, so I might include it if anyone's think it might cause the problem but I don't want to make the question too long
Note: if I replace the HttpResponse with a simple one like this
HttpResponse('Hi')it works!