#map-tools
A GeoDjango app for creating maps.
- API: http://localhost:8000/api/
- Demo Map: http://localhost:8000/
-
Python: The buzzfeed dev setup kickstart script should take care of your python setup. If you're having trouble setting up a virtualenv make sure the following is in
~/.bash_profile
, then run ``source ~/.bash_profile`.export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/Devel source /usr/local/bin/virtualenvwrapper.sh
-
Postgres: The django app uses a PostgreSQL database with GIS functionality. To install postgres installed and get it running(source):
$ brew install postgresql $ brew install postgis $ ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents $ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
-
GeoDjango also requries GDAL and libgeoip.
$ brew install gdal $ brew install libgeoip
-
Sass:
$ sudo gem install sass
-
Create virtualenv and install requirements.
$ mkvirtualenv mapper $ pip install -U -r requirements.txt
-
Setup PostGIS database and enable spatial functionality.
$ createuser --superuser geo $ createdb geodjango --owner=geo $ psql geodjango > CREATE EXTENSION postgis;
-
Create a secret settings file and get contents from someone working on project.
$ cd mapper $ touch settings/secret.py
-
Run initial django migrations.
$ cd mapper $ python manage.py migrate
-
Start server.
$ cd mapper $ python manage.py runserver
You can use the import_points
management command to import map points from a csv into the database.
$ cd mapper
$ python manage.py import_points --map=bikes --file=../data/citibike-demo.csv