How to use OpenProximity with PostgreSQL

Work in progress: This are just some notes I'm making during OP3 test so I don't have to go over and over the process every time I need it.

Install PostgreSQL, pyscopg2 and PgAdmin3 (option, but highly recommened):

sudo apt-get install postgresql pgadmin3 python-psycopg2

Create a super user, assign a password, and create a schema for OpenProximity:

$ sudo -u postgres createuser -P openproximity
  Enter password for new role: 
  Enter it again: 
  Shall the new role be a superuser? (y/n) y

$ sudo -u postgres psql template1
  psql (8.4.8)
  Type "help" for help.

  template1=# CREATE DATABASE openproximity OWNER openproximity ENCODING 'UTF8';
  CREATE DATABASE
  template1=# \q

edit /etc/openproximity2.conf, add:

[databases_dict]
default = PostgreSQL_database

# uncomment and customize what comes next to get PostgreSQL support
[PostgreSQL_database]
engine = django.db.backends.postgresql_psycopg2
host = <host>
port = <port>
name = <database>
password = <passwd>
user = <username>

That should be all.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License