[Fixed]-Django: Identify the urls that provide duplicate content and set a canonical link

1👍

The way i understood your question, you may want to get the maximum distance in meters that produce the same result as the current distance (say m meters):

next_number = People.objects.filter(meters_away__gte=m).order_by('meters_away')[:1]
next_number = next_number[0] if next_number else m

and the canonical url will be:

http://example.com/range/<next_number>

Leave a comment