Giter Club home page Giter Club logo

heroku-buildpack-geoip-geolite2's Introduction

Heroku Buildpack: GeoLite2 GeoIP data

Build Status

This is an unofficial Heroku buildpack that installs the latest GeoLite2 City and Country free IP geolocation databases from MaxMind along with the libmaxminddb C library for fast lookups in the databases.

Note an older version of the Country database is available in any Heroku deploy via the packages geoip-bin, geoip-database, and libgeoip1 listed on https://devcenter.heroku.com/articles/stack-packages

Usage

The GeoLite2 databases are distributed under the Creative Commons Attribution-ShareAlike 4.0 International License. The official download page suggests the attribution requirement may be met by including the following in all advertising and documentation mentioning features of or use of the databases:

This product includes GeoLite2 data created by MaxMind, available from
<a href="http://www.maxmind.com">http://www.maxmind.com</a>.

As of 30-Dev-2019, Maxmind has withdrawn unauthenticated downloads of their free GeoLite2 databases. Read more here.

From Jan-2020 users need a Maxmind account, and a valid license key. This buildpack uses the "direct download" method described in the Maxmind developer documentation (https://dev.maxmind.com/geoip/geoipupdate/#Direct_Downloads).

Heroku

$ heroku buildpacks:add https://github.com/danstiner/heroku-buildpack-geoip-geolite2.git

In order to download the Maxmind databases, you will need a valid Maxmind license (register with Maxmind and click on "My License Key" in the left-hand menu). You must add this key as an environment variable (setting) called MAXMIND_LICENSE_KEY.

Django GeoIP2

Add to your settings.py file:

GEOIP_PATH=os.environ['GEOIP_GEOLITE2_PATH']
GEOIP_CITY=os.environ['GEOIP_GEOLITE2_CITY_FILENAME']
GEOIP_COUNTRY=os.environ['GEOIP_GEOLITE2_COUNTRY_FILENAME']

See https://docs.djangoproject.com/en/1.11/ref/contrib/gis/geoip2/ for installing the geoip2 Python library and usage examples.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.