summaryrefslogtreecommitdiff
path: root/readme.md
blob: a6da04fe8454ef7b0b1a59da9195c958fcc637f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# PostgreSQL Performance Farm

This repository contains the code for the PostgreSQL Performance Farm.

IMPORTANT: migrating from Python2 to Python3 is in progress, hence why code might not work - for any issues feel free to contact @ila at ilaria.battiston@gmail.com

----

#### Configuration

```bash
refs/remotes/origin/masterweb/
```

The web/ directory contains the Django application that forms the basis of the website. In order to run the site, you will need to setup a Python `virtualenv`, e.g:

```bash
$ sudo pip install virtualenvwrapper
$ source /usr/local/bin/virtualenvwrapper.sh
$ mkvirtualenv pgperffarm
```

For ease of future use, configure virtualenvs from your `.bash_profile`:

```bash
$ echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bash_profile
```

To activate the environment in future sessions, run:

```bash
$ workon pgperffarm
```

Then, install the required modules. Note that we use Django 1.8 as that's what is currently supported on the postgresql.org infrastructure:

```bash
$ PATH=$PATH:/usr/local/pgsql/bin pip install -r web/requirements.txt
```

Next, create a `settings_local.py` file::

```bash
$ cp web/pgperffarm/settings_local.py.in web/pgperffarm/settings_local.py
```

Edit the file and change the database configuration and other settings to suit your environment. Make sure you create the required database and user account on your PostgreSQL server.

Finally, synchronise the database:

```bash
$ cd web
$ python manage.py makemigrations
$ python manage.py migrate
```

That should be all. To test, run the following command and point a browser at the URL shown:

```bash
$ python manage.py runserver
```

You should see the index page of the application.