diff options
author | Magnus Hagander | 2009-02-20 14:07:28 +0000 |
---|---|---|
committer | Magnus Hagander | 2009-02-20 14:07:28 +0000 |
commit | 690818edab06a7330fb9f44f03b984765b9c1874 (patch) | |
tree | 2164d21da5e2d1e144213e399d2829358b5e8fa1 /planet | |
parent | 5962538e3db56db2091cd37bb9a78451b0c26723 (diff) |
Remove hardcoded connection string (incl password) and put it in the settings
file instead.
Also, inherit from Model implementation so we can use permissions should we want to.
git-svn-id: file:///Users/dpage/pgweb/svn-repo/trunk@2415 8f5c7a92-453e-0410-a47f-ad33c8a6b003
Diffstat (limited to 'planet')
-rw-r--r-- | planet/planetadmin/auth.py | 6 | ||||
-rw-r--r-- | planet/planetadmin/local_settings.py.sample | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/planet/planetadmin/auth.py b/planet/planetadmin/auth.py index 3df82bc6..acd25265 100644 --- a/planet/planetadmin/auth.py +++ b/planet/planetadmin/auth.py @@ -1,9 +1,11 @@ from django.contrib.auth.models import User +from django.contrib.auth.backends import ModelBackend +from django.conf import settings import psycopg2 -class AuthBackend: +class AuthBackend(ModelBackend): def authenticate(self, username=None, password=None): - conn = psycopg2.connect('host=wwwmaster.postgresql.org dbname=186_www user=auth_svc password=g7y3m9u8 sslmode=require') + conn = psycopg2.connect(settings.AUTH_CONNECTION_STRING) try: conn.set_client_encoding('UNICODE') cur = conn.cursor() diff --git a/planet/planetadmin/local_settings.py.sample b/planet/planetadmin/local_settings.py.sample index 7d297881..304ad43a 100644 --- a/planet/planetadmin/local_settings.py.sample +++ b/planet/planetadmin/local_settings.py.sample @@ -7,3 +7,4 @@ DEBUG = True NOTIFYADDR='some@where.com' +AUTH_CONNECTION_STRING='put community login connection string here' |