~ev/errors/js-oops

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# This script sets up a postgres database for storing openid credentials. You
# need this if you want to view bucket and instance pages.

if [ -z "$1" ]; then
	echo "usage: $0 /path/to/lp/daisy"
	exit 1
fi
if [ ! -e $1/local_config.py ]; then
	echo "Please set up $1/local_config.py first."
	exit 1
fi
echo "create database django_db; create user django_login with password 'django_password';" | sudo -u postgres psql
sed -i "s/PASSWORD': ''/PASSWORD': 'django_password'/g" $1/local_config.py
echo "GRANT ALL PRIVILEGES ON DATABASE django_db to django_login;" | sudo -u postgres psql
PYTHONPATH=$1 ./errors/manage.py syncdb --settings=settings --noinput
PYTHONPATH=$1 ./tools/add_teams.py