Loading…
../projects
Diagram of one request through the dealer locator: a brand domain arrives, the hostname picks the site, the visitor is located by cookie, IP address, or a default city, and the search widens from 10 to 40 miles until it reaches dealers

Dealer locator platform

Contract work on a Django application that runs dealer-locator websites for HVAC brands from one codebase. A homeowner lands on a brand's site and sees the dealers who serve their area.

role
Python and Django development · contract work for Mediagistic
status
live
stack
Python · Django · PostgresSQL
Brand sites
9
Codebase
1

What it is

One Django application runs nine dealer-locator websites for HVAC manufacturer and distributor brands. Each site has its own domain, its own design, and its own search rules. All of them share one codebase and one database.

A homeowner arrives on a brand's site. The site works out roughly where they are and shows the dealers who serve that area, and a form on the page sends their enquiry on as a lead.

My role

I worked on this as a contractor for Mediagistic, the agency that runs it.

Over the past year that has been a run of projects on the live sites. "How it works" below describes the platform as a whole. The projects under "What I built" are mine.

How it works

One codebase, many sites

The application reads the hostname of each request and looks up which site it belongs to. From there the request gets that site's own pages, search rules, and templates. Adding a brand means adding one module and one folder of templates, not standing up another application.

Finding the visitor

The site tries three things in order: a location the visitor already chose, saved in a signed cookie; a lookup of their IP address; and a default city when both fail. A search by ZIP code or city is answered from a local table of postal codes, so the common case never waits on an outside service.

A radius that widens

Distance is calculated in the database with PostGIS. Each brand sets a ladder of distances, and the search steps outward until it finds dealers. One brand goes 10, 15, 25, then 40 miles. Another uses a single 100 mile radius, because its dealers are spread thin.

Not always nearest first

Dealers within range are shuffled with a weighting, so the closest one does not take the top spot on every visit.

Imports that cannot half-finish

Dealer lists arrive as spreadsheets, often with a folder of logos. The import checks the whole file before changing anything, shows a preview of what will change, and writes only after someone confirms. It runs as one transaction, so a bad row cannot leave a brand with half a dealer list.

What I built

One site carries more than one brand. A parameter on a campaign link switches that site's theme and the brand names it shows, and the choice holds for the rest of the visit. Someone who clicks an ad for one brand lands on a site dressed for that brand, with the same dealers underneath.

A second campaign link limits one site's results to dealers in the brand's certified program. It looks within 15 miles, then 25, and falls back to the full dealer list when no certified dealer is close. It also reports the state of the campaign to Google Tag Manager, so the campaign can be measured and checked.

A lead form when no dealer is close

On one site, a visitor with no dealer within 30 miles now gets a lead form. Their enquiry reaches the client instead of ending at an empty results page.

A new brand site

I added a new tenant: another brand's site on the same codebase, with its own domain, templates, and search rules.

A new hero and dealer page

I redesigned a hero section and a dealer page. The aim was to change the messaging, modernize the main areas of the locator, and clean up how the pages behave on smaller screens. The new hero also shows a simplified view of the three closest dealers.

What I learned

The copy of the code on my own machine is for editing only. It has no database and none of the mapping libraries, so nothing runs there. Real runs happen on a remote development server, and a deploy is a CI job on the main branch. That makes a written plan, and a review of it, worth the time before any code reaches that server.

The review paid off on the lead form. That site bundles Materialize 0.97.8, an old version where the modal functions my plan called do not exist. A reviewer caught it before the development server did. On an older site, check the version that is actually shipped, not the current documentation.

©2026