From 3aae781761f00b9e4775d89c7226f6721cb83356 Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Fri, 2 Sep 2011 09:46:30 +0200 Subject: [PATCH] Add apache config. --- conf/apache2.conf | 28 ++++++++++++++++++++++++++++ gazetteer/places/models.py | 3 +-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 conf/apache2.conf diff --git a/conf/apache2.conf b/conf/apache2.conf new file mode 100644 index 0000000..1fefb31 --- /dev/null +++ b/conf/apache2.conf @@ -0,0 +1,28 @@ + + ServerName gazetteer.in + ServerAlias www.gazetteer.in + + + Options -Indexes + + + Order deny,allow + Allow from all + + + Alias /.bzr /srv/gazetteer/gazetteer/.bzr + Alias /static /srv/gazetteer/gazetteer/static + Alias /favicon.ico /srv/gazetteer/gazetteer/static/favicon.ico + Alias /media /srv/gazetteer/gazetteer/media + Alias /admin/media /srv/gazetteer/src/django/django/contrib/admin/media + WSGIScriptAlias / /srv/gazetteer/wsgi/django.wsgi + + WSGIDaemonProcess gazetteer user=gazetteer group=gazetteer threads=25 python-path=/srv/gazetteer/lib/python2.6/site-packages/ + WSGIProcessGroup gazetteer + + LogLevel warn + ErrorLog /var/log/apache2/gazetteer_errors.log + CustomLog /var/log/apache2/gazetteer.log combined + + ServerSignature Off + diff --git a/gazetteer/places/models.py b/gazetteer/places/models.py index aa269a3..351fda4 100644 --- a/gazetteer/places/models.py +++ b/gazetteer/places/models.py @@ -32,8 +32,7 @@ class FeatureSearchManager(models.GeoManager): if srid != 4326: bbox.transform(4326) # convert to lon/lat qset = qset.filter(geometry__bboverlaps=bbox) if text: - self.set_threshold(threshold) - text = text.replace("'", "''") # escape the ' + #self.set_threshold(threshold) # use the pg_trgm index qset = qset.extra(select={"similarity":"similarity(preferred_name, %s)"}, select_params=[text],