maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [PATCH] Allows to have separate DBs for GIS OSM info an


From: David Decotigny
Subject: [Maposmatic-dev] [PATCH] Allows to have separate DBs for GIS OSM info and rendering DB.
Date: Sun, 6 Sep 2009 14:22:31 +0200

The assumption that the OSM postGIS DB was the same as the DB used for
the rendering (shared with maposmaticd) doesn't allow to run 2
instances of the maposmatic/maposmaticd engine (eg. a prod and a dev
instance). This patch allows this by differentiating both DB. This
makes it possible to share the same OSM db by both instances, but to
have separate rendering info.
---
 www/maposmatic/views.py        |    2 +-
 www/settings_local.py.template |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/www/maposmatic/views.py b/www/maposmatic/views.py
index 1a25a87..8a15426 100644
--- a/www/maposmatic/views.py
+++ b/www/maposmatic/views.py
@@ -41,7 +41,7 @@ import www.settings
 def city_exists(city):
     try:
         conn = psycopg2.connect("dbname='%s' user='%s' host='%s' 
password='%s'" % \
-                                    (www.settings.DATABASE_NAME, 
www.settings.DATABASE_USER,
+                                    (www.settings.GIS_DATABASE_NAME, 
www.settings.DATABASE_USER,
                                      www.settings.DATABASE_HOST, 
www.settings.DATABASE_PASSWORD))
     except psycopg2.OperationalError:
         return False
diff --git a/www/settings_local.py.template b/www/settings_local.py.template
index 985d6c0..fd3febe 100644
--- a/www/settings_local.py.template
+++ b/www/settings_local.py.template
@@ -32,6 +32,7 @@ ADMINS = (
 
 DATABASE_ENGINE = 'postgresql_psycopg2'           # 'postgresql_psycopg2', 
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
 DATABASE_NAME = 'testdb'             # Or path to database file if using 
sqlite3.
+GIS_DATABASE_NAME = 'testdb'             # Or path to PostGIS database file if 
using sqlite3.
 DATABASE_USER = 'test'             # Not used with sqlite3.
 DATABASE_PASSWORD = 'test'         # Not used with sqlite3.
 DATABASE_HOST = 'localhost'             # Set to empty string for localhost. 
Not used with sqlite3.
-- 
1.6.0.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]