Перейти к содержимому
SEO

Technical SEO Checklist for Django Websites

Ruslan Danelian 11 мин чтения
Скопировано!
Technical SEO Checklist for Django Websites

Need help with SEO and local search optimization? I provide SEO and local search optimization for businesses ready to grow. Learn about my SEO and local search optimization service or get in touch for a free consultation.

Key Takeaways
  • Understand why I Care About Technical SEO on Django Projects
  • Canonical Tags: Django's Duplicate Content Trap
  • Structured Data: Speak Google's Language
  • The Pre-Launch Routine

Why I Care About Technical SEO on Django Projects

I'm Ruslan Danelian, a freelance web developer and Google Ads specialist. Most of my clients are US service businesses — HVAC companies in Texas, plumbing outfits in Ohio, law firms in Florida. They come to me because their site is slow, their leads dried up, or their ad spend is bleeding money on pages Google doesn't even index properly.

Here's the thing I've learned after building dozens of Django sites for these folks: a beautiful website that search engines can't crawl cleanly is just an expensive brochure. Django gives you enormous control over your URLs, templates, and responses, which means it also gives you plenty of rope to hang yourself with. Duplicate content from pagination, orphaned staging subdomains, missing canonical tags on filtered views — I've seen all of it in the wild.

This is the checklist I run through on every Django project before launch. Four areas, no fluff: sitemaps, canonicals, structured data, and robots.txt. Let's walk through them.

Sitemaps: Tell Google Exactly What Matters

🔍 Illustration: annotated screenshot or diagram illustrating Sitemaps: Tell Google Exactly What Matters
Visual guide: Sitemaps: Tell Google Exactly What Matters

Django ships with a built-in sitemap framework (django.contrib.sitemaps), and honestly, it's one of the best out-of-the-box SEO features of any web framework I've worked with. Yet I still audit sites where the developer never enabled it, or worse, generated a sitemap that lists 4,000 URLs including thank-you pages and admin redirects.

What I actually do

  • Register the app and the sites framework. Add both django.contrib.sitemaps and django.contrib.sites to INSTALLED_APPS, then set SITE_ID correctly. I once spent an hour debugging a sitemap full of example.com URLs because someone forgot to update the Site object in the database. Check it in the admin before you do anything else.
  • Split sitemaps by content type. For a Dallas roofing client, I created separate sitemap classes for service pages, city landing pages, and blog posts. Each class defines its own queryset, changefreq, and priority. This makes Search Console reporting far more useful — I can see instantly that the city pages are indexed at 98% while the blog sits at 60%.
  • Set lastmod from a real timestamp. Use your model's updated_at field via the lastmod method. Google uses this to prioritize recrawls. A static or fake lastmod date trains Google to ignore your hints.
  • Exclude what shouldn't be indexed. No cart pages, no login pages, no internal search results, no paginated archives beyond page one (more on that below). My rule: if a page wouldn't earn a click from a stranger, it doesn't belong in the sitemap.
  • Watch the 50,000 URL / 50MB limit. Django handles pagination of large sitemaps automatically with a sitemap index, but verify it works. I test by hitting the sitemap index URL directly and checking each child sitemap returns a 200.

A practical example

One plumbing client had location pages generated for every zip code they served — about 300 pages. Their old sitemap included thin auto-generated pages for zips where they'd never done a job. We trimmed the queryset to only locations with actual content and reviews, resubmitted, and watched crawl waste drop noticeably in Search Console's crawl stats within two weeks. Fewer, better URLs beat more, weaker ones almost every time.

Finally: submit the sitemap in Search Console and reference it in robots.txt. Belt and suspenders.

One plumbing client had location pages generated for every zip code they served — about 300 pages.

Canonical Tags: Django's Duplicate Content Trap

This is where Django sites get into trouble quietly. The framework will happily serve the same content at multiple URLs, and unless you're deliberate, Google has to guess which version counts.

The usual suspects

  • Trailing slashes. Django's APPEND_SLASH setting redirects non-slash URLs, which is good — but make sure it's a proper 301, and that your canonical always points to the slash version consistently.
  • Query parameters. UTM tags from my own Google Ads campaigns are the classic offender. A click from an ad lands on /services/ac-repair/?utm_source=google&utm_medium=cpc, and without a canonical, that parameterized URL can end up indexed. Every service page template on my builds outputs a canonical link built from the request path only, stripping query strings unless the parameter genuinely changes content.
  • HTTP vs HTTPS and www vs non-www. Handle this at the server or middleware level with permanent redirects, then make the canonical match your chosen domain exactly. Pick one canonical hostname and enforce it everywhere.
  • Pagination. For a blog listing at /blog/?page=2, the canonical should point to page 2 itself — not to page 1. This is a mistake I see constantly. Each paginated page is unique content; self-referencing canonicals are correct here. Just keep paginated pages out of the sitemap.

How I implement it

I add a canonical block to the base template and build the absolute URL from the site's canonical domain plus the object's get_absolute_url() method. Because every model already defines get_absolute_url for the sitemap, I get consistency for free — the sitemap URL and the canonical URL are generated from the same source of truth. That single architectural decision has prevented more duplicate-content issues than any audit tool ever caught.

Test it: load a page with junk parameters appended, view source, and confirm the canonical is clean. Then check the URL Inspection tool in Search Console — it shows you both the user-declared canonical and Google's selected canonical. When those two disagree, you have work to do.

Pro Tip

Test it: load a page with junk parameters appended, view source, and confirm the canonical is clean.

Structured Data: Speak Google's Language

For US service businesses, structured data isn't optional decoration — it's how you tell Google "this is a LocalBusiness, here's the service area, here are the reviews." I pair this with Google Ads work, and rich results consistently lift organic click-through rates on the same pages my ads target, which lowers overall acquisition cost.

What I mark up on service sites

  • LocalBusiness (or a subtype like Plumber, HVACBusiness, LegalService). Name, address, phone, geo coordinates, opening hours, and areaServed. I pull these from a SiteSettings model so the client can update their phone number in the Django admin without touching a template. One less support ticket for me.
  • Service schema on individual service pages, linked to the parent business entity.
  • FAQPage on pages with genuine question-and-answer content. A garage door client saw FAQ rich results appear within a month of adding valid markup — real questions customers asked, marked up honestly.
  • BreadcrumbList sitewide. It's cheap to implement with a template tag and improves how your URLs display in results.
  • Article on blog posts, with real author and datePublished values from the model.

Implementation notes from the trenches

I use JSON-LD in a script block within the template head, assembled from context data — never hand-typed static blobs that drift out of sync with the page. If the price or hours change in the database, the schema updates automatically. That's the whole advantage of a dynamic framework: your structured data should be as dynamic as your content.

Two warnings from experience. First, don't mark up reviews you don't actually display on the page — Google penalizes invisible markup, and aggregateRating without visible reviews is a manual action waiting to happen. Second, validate everything with the Rich Results Test and Schema.org validator before launch, then re-check after any template refactor. I've seen a well-meaning redesign silently drop the JSON-LD block from a child template override. Six weeks later, rich results vanished. Now it's on my post-deploy smoke-test list.

Want expert help with this? Let's make it happen.

Get a Free Consultation

Robots.txt: The Bouncer at the Door

🎯 Illustration: diagram illustrating Robots.txt: The Bouncer at the Door
Visual guide: Robots.txt: The Bouncer at the Door

Robots.txt is small, humble, and easy to get catastrophically wrong. The single scariest line in web development is Disallow: / left over from staging.

My standard setup

  • Serve it dynamically per environment. I render robots.txt through a Django view with a plain-text content type. In production it allows crawling and references the sitemap. On staging, the same view returns a full disallow. The template checks an environment setting, so a staging config can never accidentally ship an open robots file — and production can never ship a closed one. This one pattern has saved me from disaster more than once.
  • Block the right things. Disallow the admin path, internal search results, cart and checkout flows, and any parameter-heavy faceted URLs that create infinite crawl spaces. For an equipment parts catalog I built, faceted filtering could generate millions of URL combinations. Robots rules plus canonicals kept the crawl budget focused on real product pages.
  • Don't block CSS and JS. Google needs to render your pages. Blocking your static files directory is a self-inflicted wound I still find on older sites.
  • Remember: robots.txt is not an indexing control. A disallowed URL can still get indexed if other sites link to it. For pages that must stay out of the index — thank-you pages, gated PDFs — use a meta robots noindex tag instead, and make sure those pages are allowed in robots.txt so Google can actually see the noindex. Blocking and noindexing the same page is a contradiction I explain to clients at least once a month.

I also rename the admin URL away from the default on every build — security through obscurity isn't real security, but there's no reason to advertise your login path to every crawler and script kiddie either.

The Pre-Launch Routine

Before any Django site goes live for a client, I run the same four-point pass: fetch the sitemap and spot-check URLs, load key pages with tracking parameters and inspect canonicals, run the Rich Results Test on one page of each template type, and read robots.txt line by line against the environment. Then I watch Search Console coverage for the first two weeks like a hawk.

None of this is glamorous. But when a Phoenix landscaping company's city pages start ranking and the phone rings from organic and paid without cannibalizing each other, that's the payoff. Technical SEO in Django isn't hard — the framework hands you every tool you need. It just demands that you actually use them, deliberately, every single time.

If your Django site is leaking crawl budget or your ads are landing on pages Google ignores, that's exactly the kind of problem I fix for a living. Get the fundamentals right first — everything else compounds from there.

Related reading: How Much Does SEO Cost for a Small Business in 2027? — a plain breakdown of SEO pricing models, what each includes and what is worth paying for.

Technical SEO Checklist for Django Websites infographic (English version)
Technical SEO Checklist for Django Websites infographic (versión en español)
Technical SEO Checklist for Django Websites infographic (версия на русском)
📌 Save this infographic for quick reference

Frequently Asked Questions

What is technical SEO?

It is the work that helps search engines crawl, understand and index your site: site structure, sitemaps, robots rules, speed, canonical tags and structured data.

How do I create a sitemap in Django?

Django includes a sitemaps framework. Define a sitemap class for each model or view, register it in your URLs and submit the result in Google Search Console.

What are the most common technical SEO mistakes?

Blocking pages in robots.txt by accident, missing or duplicate canonical tags, slow pages, broken redirects and pages left out of the sitemap.

How often should I run a technical SEO audit?

Run one before launch and after major changes, then review key signals in Search Console regularly so problems are caught early.

Ruslan Danelian
Ruslan Danelian

Full-stack разработчик, специализирующийся на Django, ИИ-автоматизации и управлении Google Ads. Создаю production SaaS платформы и кастомные веб-приложения для бизнеса по всей территории США.

Читайте далее

Есть ли у вас проект в планах?

Расскажите, что вам нужно. В течение одного рабочего дня я пришлю план со сроками и фиксированной стоимостью.

Year-end offer

20% off AI tools & custom CRM

AI chat assistants, DM bots, lead scoring and a CRM built around your business.

Claim 20% off