Technical SEO for Django Websites: The Complete Developer's Checklist
Technical SEO is the foundation everything else is built on. Here is the complete checklist I use for every Django project — meta tags, sitemaps, schema.org, Core Web Vitals, and more.
mubashar
Technical SEO is the foundation everything else is built on. You can write the best content in your industry, but if search engines cannot crawl, index, and understand your site correctly, it will not rank. Here is the complete technical SEO checklist I use for every Django project.
1. URL structure
Django gives you full control over URLs — use it well. Follow these rules:
- Use hyphens, not underscores:
/blog/technical-seo-guide/not/blog/technical_seo_guide/ - Keep URLs lowercase
- Use trailing slashes consistently (Django's
APPEND_SLASH = Truehandles this) - Avoid dynamic query strings for canonical content — use clean path-based URLs
2. Meta tags in Django templates
Every page needs a unique <title> (under 60 characters) and <meta name="description"> (under 160 characters). Use template inheritance to set site-wide defaults and override per page:
{% block title %}{{ post.meta_title|default:post.title }}{% endblock %}
{% block meta_description %}{{ post.meta_description }}{% endblock %}
3. Canonical URLs
Prevent duplicate content by setting canonical URLs on every page. For Django, add this to your base template:
<link rel="canonical" href="{{ request.build_absolute_uri }}">
For blog posts with potential duplicates (pagination, tag pages), explicitly set the canonical to the original post URL.
4. XML Sitemap
Django's built-in django.contrib.sitemaps makes sitemap generation straightforward. Create a sitemaps.py in your app and wire it up in urls.py. Submit to Google Search Console once it is live.
5. Schema.org structured data
Add JSON-LD structured data to help search engines understand your content type. For a blog post:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "{{ post.title }}",
"author": { "@type": "Person", "name": "Mubashar Iqbal" },
"datePublished": "{{ post.published_at|date:'c' }}"
}
</script>
6. Open Graph and Twitter Cards
Control how your pages appear when shared on social media. Minimum required tags:
<meta property="og:title" content="{{ page_title }}">
<meta property="og:description" content="{{ page_description }}">
<meta property="og:image" content="{{ og_image_url }}">
<meta name="twitter:card" content="summary_large_image">
7. Robots.txt
Block search engines from crawling pages that should not appear in search results — admin, API endpoints, staging paths. Serve robots.txt as a Django view so it stays in version control:
def robots_txt(request):
return HttpResponse("User-agent: *
Disallow: /admin/
Sitemap: https://yourdomain.com/sitemap.xml",
content_type="text/plain")
8. Core Web Vitals
Google's ranking signals include Largest Contentful Paint (LCP), First Input Delay (FID), and Cumulative Layout Shift (CLS). For Django sites:
- LCP: Serve static files via a CDN, enable Django's cache framework, preload hero images with
<link rel="preload"> - CLS: Always specify width and height on
<img>tags - FID/INP: Minimise JavaScript. HTMX keeps this naturally low.
9. HTTPS and security headers
Django's production settings include HSTS, SECURE_SSL_REDIRECT, and SECURE_CONTENT_TYPE_NOSNIFF. Use all of them. Google has used HTTPS as a ranking signal since 2014.
Audit tools
Run your site through Screaming Frog, Google Search Console, and PageSpeed Insights regularly. Fix critical issues first. Technical SEO is not a one-time task — it is an ongoing audit process.
Written by
Mubashar Iqbal
Web developer, SEO expert, and independent maker. I build products, write about what I've learned, and create free tools for developers and marketers.