About Canonical URLs

Canonical URLs are used to indicate the preferred version of a webpage when multiple URLs have similar or duplicate content, helping to avoid SEO issues like duplicate content penalties.

Set this in your base.html to make sure that URLs with query parameters are not counted by search engines as separate URLs:

<link rel="canonical" 
href="{{ request.scheme }}://{{ request.get_host }}{{ request.path }}" />

Tips and Tricks Development Search Engine Optimization (SEO) Django 5.2 Django 4.2 Django 3.2

Django/Python Consulting

If you have a specific Django challenge or integration you'd like to solve, I'd be happy to help. Book a free 30-minute call to discuss your project, see if we're a good fit, and explore the best approach for your needs. After the call, you'll receive a tailored cost estimate based on what we discuss.