summaryrefslogtreecommitdiffstats
path: root/pharos-dashboard/deploy.org
blob: b8399215c96a9547b26cbb70963cb7b5b9e3e78d (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
* Database

** Setup
-   sudo -u postgres psql
-   postgres=# CREATE DATABASE pharos_dashboard
-   postgres=# CREATE USER opnfv WITH PASSWORD 'opnfvopnfv'
-   postgres# createuser --interactive
-   postgres# ALTER ROLE opnfv SET client_encoding TO 'utf8';
-   postgres# ALTER ROLE opnfv SET default_transaction_isolation TO 'read committed';
-   postgres# ALTER ROLE opnfv SET timezone TO 'UTC';
-   postgres# GRANT ALL PRIVILEGES ON DATABASE pharos_dashboard TO opnfv;

** Dump data

-   log out all users, stop server
-   (venv) # python manage.py dumpdata > dashboard/fixtures/<dump_name>.json

** Load dump

-   setup clean database, run migrate
-   (venv) # python manage.py loaddata <dump_name>

* Django

** Virtualenv setup

-   # virtualenv venv
-   # source venv/bin/activate
-   (venv) # pip install -r requirements.txt

** initializing or after change in models.py

-   (venv) # python manage.py makemigrations
-   (venv) # python manage.py migrate

** Development

-   (venv) # python manage.py runserver
-   (venv) # python manage.py shell  

* Dependencies

Javascript / CSS dependencies are managed with bower. To install them, you have to install bower, switch directory to the dashboard/static folder and run 
# bower install
Bower will download and install the right versions of all the static files.