Home > django-simplegeo-demos

django-simplegeo-demos

Django-simplegeo-demos is a project mainly written in PYTHON and JAVASCRIPT, it's free.

A demo Django application showing how to use SimpleGeo Context with Flickr's Panda API

Overview

This is a place for SimpleGeo demos to be housed and collaborated upon.

Flickr Photo Demo

This is a simple Django application that will load up a number of geo-tagged Flickr photos from the Wang Wang Panda API. It then runs all of those photos through the SimpleGeo Context API, which allows us to further tag the data with relevant geographic information. The photos are then presented in a simple, searchable interface.

Setup

  1. Make sure all of the Python packages in requirements.txt are installed.

     virtualenv --no-site-packages .
     . bin/activate
     pip install -r requirements.txt
  2. Change into the sgdemos directory.

  3. Create overrides.m4 in the sgdemos directory and add the following variables to it:

     define(`__FLICKR_API_KEY__', `YOUR_FLICKR_API_KEY_HERE')
     define(`__SIMPLEGEO_TOKEN__', `YOUR_SIMPLEGEO_OAUTH_TOKEN_HERE')
     define(`__SIMPLEGEO_SECRET__', `YOUR_SIMPLEGEO_OAUTH_SECRET_HERE')
  4. Run make.

  5. Run ./manage.py syncdb and follow the instructions.

  6. Load some photos.

  7. Run ./manage.py runserver 127.0.0.1:8888.

  8. Point your browser to http://127.0.0.1:8888.

Loading Photos

From the sgdemos directory run the following Django command:

./manage.py loadphotos --limit 500