From 5030d257b5d7ec0f86a2b6b2eedf929cdef83791 Mon Sep 17 00:00:00 2001 From: Flavio Curella Date: Sun, 3 Jun 2012 12:23:37 -0500 Subject: [PATCH] Added `postgis://` url scheme --- README.rst | 2 +- dj_database_url.py | 3 +++ setup.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 96b7d2b..d00d207 100644 --- a/README.rst +++ b/README.rst @@ -20,7 +20,7 @@ Parse an arbitrary Database URL:: Supported databases ------------------- -Support currently exists for PostgreSQL, MySQL and SQLite. +Support currently exists for PostgreSQL, PostGIS, MySQL and SQLite. SQLite connects to file based databases. The same URL format is used, omitting the hostname, and using the "file" portion as the filename of the database. diff --git a/dj_database_url.py b/dj_database_url.py index 46c7ac3..2394abe 100644 --- a/dj_database_url.py +++ b/dj_database_url.py @@ -42,6 +42,9 @@ def parse(url): if url.scheme == 'postgres': config['ENGINE'] = 'django.db.backends.postgresql_psycopg2' + if url.scheme == 'postgis': + config['ENGINE'] = 'django.contrib.gis.db.backends.postgis' + if url.scheme == 'mysql': config['ENGINE'] = 'django.db.backends.mysql' diff --git a/setup.py b/setup.py index 16a0bbb..090129d 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ from setuptools import setup setup( name='dj-database-url', - version='0.2.0', + version='0.2.1', url='https://github.com/kennethreitz/dj-database-url', license='BSD', author='Kenneth Reitz',