You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ This repository contains the code for the user interface. The simulations are pe
21
21
22
22
Prior to be able to develop locally, you might need to install postgres, simply google `install postgres` followed by your os name (`linux/mac/windows`)
23
23
24
-
1. Create a virtual environment
24
+
1. Create a virtual environment using `python=3.12`
25
25
2. Activate your virtual environment
26
26
3. Move to the `app` folder with `cd app`
27
27
4. Install local development dependencies with `pip install -r requirements/local.txt`
@@ -35,18 +35,18 @@ SQL_HOST=localhost
35
35
SQL_PORT=5432
36
36
TRUSTED_HOST=http://127.0.0.1:8000
37
37
DEBUG=(True|False)
38
-
MVS_HOST_API=<the simulation server you wish to use>
38
+
MVS_API_HOST=<the simulation server you wish to use>
39
39
```
40
-
6. Execute the `local_setup.sh` file (`. local_setup.sh` on linux/mac `bash local_setup.sh` on windows) you might have to make it executable first. Answer yes to the question
41
-
7. Start the local server with `python manage.py runserver`
42
-
8. You can then login with `testUser` and `ASas12,.` or create your own account
40
+
6. Set up pre-commit hooks with `pre-commit install`
41
+
7. Execute the `local_setup.sh` file (`. local_setup.sh` on linux/mac `bash local_setup.sh` on windows) you might have to make it executable first. Answer yes to the question
42
+
8. Start the local server with `python manage.py runserver`
43
+
9. You can then login with `testUser` and `ASas12,.` or create your own account
43
44
44
45
## Deploy using Docker Compose
45
46
The following commands should get everything up and running, using the web based version of the MVS API.
46
47
47
48
You need to be able to run docker-compose inside your terminal. If you can't you should install [Docker desktop](https://www.docker.com/products/docker-desktop/) first.
48
49
49
-
50
50
* Clone the repository locally `git clone --single-branch --branch main https://github.com/open-plan-tool/gui.git open_plan_gui`
51
51
* Move inside the created folder (`cd open_plan_gui`)
52
52
* Edit the `.envs/epa.postgres` and `.envs/db.postgres` environment files
@@ -55,20 +55,21 @@ You need to be able to run docker-compose inside your terminal. If you can't you
55
55
* The value assigned to the variables `POSTGRES_DB`, `POSTGRES_USER`, `POSTGRES_PASSWORD` in `.envs/db.postgres` should match the ones of
56
56
the variables `SQL_DATABASE`, `SQL_USER`, `SQL_PASSWORD` in `.envs/epa.postgres`, respectively
57
57
58
-
* Define an environment variable `MVS_HOST_API` in `.envs/epa.postgres` and set the url of the simulation server
58
+
* Define an environment variable `MVS_API_HOST` in `.envs/epa.postgres` and set the url of the simulation server
59
59
you wish to use for your models (for example `MVS_API_HOST="<url to your favorite simulation server>"`), you can deploy your own [simulation server](https://github.com/open-plan-tool/simulation-server) locally if you need
60
60
61
61
* Assign the domain of your website (including `http://` or `https://`) to `TRUSTED_HOST` , see https://docs.djangoproject.com/en/4.2/ref/settings/#csrf-trusted-origins for more information
62
62
63
63
Next you can either provide the following commands inside a terminal (with ubuntu you might have to prepend `sudo`)
64
-
*`docker-compose --file=docker-compose-postgres.yml up -d --build`
65
-
*`docker-compose --file=docker-compose-postgres.yml exec -u root app_pg sh initial_setup.sh` (this will also load a default testUser account with sample scenario).
64
+
*`docker-compose --file=docker-compose-local.yml up -d --build`
65
+
*`docker-compose --file=docker-compose-local.yml exec -u root app_pg sh initial_setup.sh` (this will also load a default testUser account with sample scenario).
66
+
66
67
67
68
Or you can run a python script with the following command
68
69
*`python deploy.py`
69
70
70
71
Finally
71
-
* Open browser and navigate to http://localhost:8080: you should see the login page of the open_plan app
72
+
* Open browser and navigate to http://localhost:8000: you should see the login page of the open_plan app
72
73
* You can then login with `testUser` and `ASas12,.` or create your own account
73
74
74
75
### Proxy settings (optional)
@@ -85,7 +86,7 @@ If you use a proxy you will need to set `USE_PROXY=True` and edit `PROXY_ADDRESS
85
86
## Tear down (uninstall) docker containers
86
87
To remove the application (including relevant images, volumes etc.), one can use the following commands in terminal:
87
88
88
-
`docker-compose down --file=docker-compose-postgres.yml -v`
89
+
`docker-compose down --file=docker-compose-local.yml -v`
89
90
90
91
you can add `--rmi local` if you wish to also remove the images (this will take you a long time to rebuild the docker containers from scratch if you want to redeploy the app later then)
0 commit comments