Add apache config.

This commit is contained in:
Schuyler Erle 2011-09-02 09:46:30 +02:00
parent add230cd03
commit 3aae781761
2 changed files with 29 additions and 2 deletions

28
conf/apache2.conf Normal file
View File

@ -0,0 +1,28 @@
<VirtualHost *:80>
ServerName gazetteer.in
ServerAlias www.gazetteer.in
<Location />
Options -Indexes
</Location>
<Directory /srv/gazetteer>
Order deny,allow
Allow from all
</Directory>
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
</VirtualHost>

View File

@ -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],