]> git.ozlabs.org Git - patchwork/commitdiff
docs: Document password-based pgsql login
authorMartin Krafft <madduck@madduck.net>
Sun, 31 Jan 2010 02:03:10 +0000 (03:03 +0100)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 10 Aug 2010 03:49:35 +0000 (11:49 +0800)
As an alternative to ident-based authentication for PostgreSQL, one can
use password-based authentication. This patch adds the alternative to
the docs.

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
docs/INSTALL

index 0ed2cea78e3afa18fddca6d370c1c3a1edc00515..7a32434688cdd7f2393fec58eaeb7e10f27e1dfa 100644 (file)
@@ -29,7 +29,10 @@ in brackets):
     user that your mail server runs as). On Ubuntu these are
     www-data and nobody, respectively.
 
     user that your mail server runs as). On Ubuntu these are
     www-data and nobody, respectively.
 
-    For PostgreSQL
+    As an alternative, you can use password-based login and a single database
+    account. This is described further down.
+
+    For PostgreSQL (ident-based)
 
         $ createdb patchwork
         $ createuser www-data
 
         $ createdb patchwork
         $ createuser www-data
@@ -39,7 +42,23 @@ in brackets):
           will only be accessible for processes running as the same username.
           This means that no passwords need to be set.
 
           will only be accessible for processes running as the same username.
           This means that no passwords need to be set.
 
-     For MySQL:
+    For PostgreSQL (password-based)
+
+        $ createuser -PE patchwork
+        $ createdb -O patchwork patchwork
+
+        Once that is done, you need to tell Django about the new Database
+        settings, using local_settings.py (see below) to override the defaults
+        in settings.py:
+
+        DATABASE_ENGINE = 'postgresql_psycopg2'
+        DATABASE_NAME = 'patchwork'
+        DATABASE_USER = 'patchwork'
+        DATABASE_PASSWORD = 'my_secret_password
+        DATABASE_HOST = 'localhost'
+        DATABASE_PORT = ''
+
+    For MySQL:
         $ mysql
         > CREATE DATABASE 'patchwork';
         > CREATE USER 'www-data'@'localhost' IDENTIFIED BY '<password>';
         $ mysql
         > CREATE DATABASE 'patchwork';
         > CREATE USER 'www-data'@'localhost' IDENTIFIED BY '<password>';
@@ -119,7 +138,9 @@ in brackets):
          cd apps/
          PYTHONPATH=../lib/python ./manage.py syncdb
 
          cd apps/
          PYTHONPATH=../lib/python ./manage.py syncdb
 
-        And add privileges for your mail and web users:
+        And add privileges for your mail and web users. This is only needed if
+        you use the ident-based approach. If you use password-based database
+        authentication, you can skip this step.
 
         Postgresql:
           psql -f lib/sql/grant-all.postgres.sql patchwork
 
         Postgresql:
           psql -f lib/sql/grant-all.postgres.sql patchwork