[Django]-How to properly set GEOIP_PATH for Django in OS X?

5๐Ÿ‘

โœ…

You need the GeoIP data which you can download from MaxMind, and you need to set up GEOIP_PATH in your settings.py module to point to wherever you download that GeoIP data.

Your directory structure might not be exactly the same as this, but for me I have

<project directory>
    ...
    geoip
    ...
    <app_directory>
        settings.py
    ...

In my settings.py I have a ROOT_PATH set up to refer to the project directory, so

GEOIP_PATH = ROOT_PATH + '/geoip'

Download the binary / gzip version of the GeoIP data you need, unzip it and put it in that geoip directory.

๐Ÿ‘คLiz Rice

0๐Ÿ‘

Same way as every other Django setting: via the settings module for the project.

Leave a comment