Hellnar
Hellnar

Reputation: 64873

Django and IP limitation

I want to limit my site to USA plus several outside-US IP adrresses (developers, QA etc..). And beside these, I want to display template saying "Coming soon to your country".

I'm curious if there's any easy or already developed plugin for this.

Upvotes: 1

Views: 138

Answers (2)

ramusus
ramusus

Reputation: 8345

On the Django level you can use GeoIP application from GeoDjango (thanks to ArturM).

But it's better do this on webserver level for performance purpose. If you are using ngingx, try HttpGeoIPModule. For apache - libapache2-mod-geoip

Upvotes: 0

ArturM
ArturM

Reputation: 703

In Django the simplest way would be to use GeoIP and custom middleware to check every request.

Upvotes: 1

Related Questions