This document discusses suitability of GeoDjango as an underlying framework for 2.0 version of Sahana - FOSS Disaster Management System. Covered areas are based on requirements document for Sahana 2.0. It was kindly provided by Marek Kuziel of Encode.net.nz.

Introduction - What is GeoDjango?

A world-class geographic web framework. It is an add-on for Django that includes support for geometry fields and extends the ORM to allow spatial queries.

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

There are many reusable application written for both Django and GeoDjango that are “production ready” and could be used. Those are pointed out as appropriate throught the document.

Sites that use GeoDjango (in no particular order):


  • Object Relational Mapping (ORM) - is built-in Django. GeoDjango extends this to allow spatial database queries
  • Connection Pooling - is not built-in
  • Data Versioning - can be achieved by using django-history
  • Audit Trial Support - can be achieved. More information.
  • Database Abstraction - is built-in as part of ORM

Quality Assurance (QA)

  • Form Validation - is built-in
  • Error and Exception Handling - built-in (error messages handling for users, etc.)
  • Security - Cross Site Request Forgery protection is part of official Django contribs. Security of any Django-based site is discussed in a Django book
  • Auditing - see Audit Trial(?)
  • Logging - powerful Python logging can be used. Custom logger for Sahana could be an option too
  • Backup - is not built-in. Custom backup solution would need to be developed
  • Unit Testing - three available options are built-in:
    • doctests - part of the code documentation. Keeps documentation up to date and tests documented functionality.
    • unittest - standard unittests
    • client tests - like unittests, but similates user's requests in order to test UI

Working List (yet to be categorised)

  • Web Services (SOAP, RSS, REST)
    • RSS - is part of contrib
    • SOAP, REST - would need to be developed. GeoDjango makes all the ground for for this quite easy, though
  • AJAX/JS - is not built-in. Any JS/AJAX library can be used. Unit testing of AJAX is possible
  • Easy Integration - 3rd party APIs can be integrated easy way. ie. Facebook's Connect can be added in 15 minutes.
  • Mobile Device Support - templating language allows to develop standard/print/mobile styles easily
  • Less Bulky - Django is bulky. You would need to look somewhere else if your priority would be very lightweight solution.
  • Loose Coupling - Django has many parts loosely coupled. Architecture-wise it is very modular with loosely coupled parts that work together well and make development easy
  • MVC - Django is MTV (Model, Template, View) which you can easily translate as Model (=Model), View (=Template), Controller (=View). MVC/MTV makes sense to use. Most of the contemporary frameworks are MVC so developers are familiar with the pattern in general.
  • Service Oriented Architecture (SOA) - this should be part of Sahana 2.0 stack if you want to go that way.
  • Scalability and Performance - nothing to worry about here with regards to GeoDjango. Good caching support with memcached, you can use fast webserver for serving static files. Reverse proxy and load balancing should be considered from the beginning for a deployment. These things are always depandant per case/installation, but there are not any limitation that could cause troubles to scale. See sites that use GeoDjango at the top for examples.
  • Large Developer Ecosystem - noting to worry about with Django. Less experts to find for GeoDjango, though. Documentation of both projects is excellent and the whole community is great.
  • Learning Curve - it's very easy to get started and learn GeoDjango. It's written in Python. Code readable and easy to understand. No “spaghetti code” horror stories as we know them from other languages. Anyway, the most important thing is, that GeoDjango makes it very easy to work with GeoSpatial data so you don't need to be GIS expert to create a new functionality.
  • Strong GeoSpatial Capabilities - this is strongest point of GeoDjango. See installation requirements for supported and used libraries and databases
  • Workflow Engine - is not built-in. GoFlow app could be a good match

QR Code
QR Code dev:fk_geodjango (generated for current page)