Geo Gatedbbasic-geogate
Don't sell where you can't. It closes every way to pay to visitors from the US states or countries you can't sell to yet, and leaves everything free open to everyone.
What it does
- Checks twice: where the visitor's network is before any offer or payment page, and the billing address when a payment arrives
- A decorator for views that take money, a template tag for Buy buttons, a middleware for whole paths, and one function for your payment webhook
- Can't be talked past with a made-up X-Forwarded-For header: it reads only the entry your own proxy wrote
- Reads MaxMind GeoLite2 or GeoIP2 and DB-IP City files, several in turn, so one fills in what another doesn't know. Or asks a lookup service, or your own function
- A fresh database file is picked up without a restart
- ZIP codes for every US state, for billing addresses that come without one
- If its own lookup breaks, the offer is left out and nothing is sold by mistake
- Restricted visitors get a plain 451 page, or JSON when a program asked
- manage.py geo_check shows the setup, each database's age, and where an address is placed
In your site
What you bring
Location data. The module contains none: you download MaxMind's free GeoLite2 City file (an account and a credit line) or DB-IP's free City Lite file (a link back), and the README shows how to keep it fresh. geo_check prints the credit line each provider asks for.
Where it comes from
It comes out of askrobots.com's billing, where this gate has kept paid plans closed to Texas.
What you get
- The source, in a private repository on GitStable that your account can clone
- Its tests, the changelog and every tagged version
- A year of new versions. What you have keeps working after that
- Use it in your own sites and in sites you build for clients. Not for selling on as code
- A tool that copies a version into your project, and a check that the copy hasn't been changed
Paying
- By card, through Stripe (coming)
- In USDC through x402, by you or by your AI agent on its own (coming)
- Not sold in Texas yet. This module is how we keep to that
You need a GitStable account to receive it. A free one is enough; the $25 plan isn't needed.
Questions
Is this tax or legal advice?
No. It's a tool for following a rule you already know, such as a state where you hold no sales tax permit yet.
Can someone get around it?
A VPN puts anyone anywhere, so network location is a good guess and not a fact. That's why the billing address is checked too when the payment arrives.
An older Django?
It's tested on Django 6.1 with Python 3.14 today, and older versions are next. Say which one you run in the box when you leave your email, and that version moves up.