The aim of this document is to explain how to set up your machine to run the executable for My Civitas
- Postgres server is neccesary
- pgAdmin is optional
- Download the installer from (https://www.postgresql.org/download/windows/)[https://www.postgresql.org/download/windows/]
- The installer is designed the be straightforward, follow the prompts in the installation wizard
- When prompted to select the applications to install, include the PostGIS bundle under Spatial Extensions
- Keep the port for postgreSQL as 5432
- Download the installer from (https://www.postgresql.org/ftp/pgadmin/pgadmin4/v6.18/windows/)[https://www.postgresql.org/ftp/pgadmin/pgadmin4/v6.18/windows/]
- Run the installer and follow the prompts in the installation wizard
- When prompted for a username and password, use
postgres
as the username andpostgres
as the password
- Open pgAdmin
- Create a user on your local postgreSQL named 'civitas_user'
- Create a user on your local postgreSQL named 'django_user'
- Create a database named
civitas
- Open the pgAdmin Query Tool in the civitas database and execute the following script 'CREATE EXTENSION postgis;'
- Open the pgAdmin Query Tool in the django database and execute the following script 'CREATE EXTENSION postgis;
- Right click on the datbase and in the dropdown select
Restore
. The format isCustom or tar
. Click on the folder icon ofFilename
field to upload the file calledcivitas_bc
(Note that we need to distribute only a 'template database' without infrastructure data included) - Create a database named
django
. Right click on the datbase and in the dropdown selectRestore
. The format isCustom or tar
. Click on the folder icon ofFilename
field to upload the file calleddjango_bc
If pgAdmin fails to restore the databases please see steps below
- Create a database called civitas
- Create a database called django
- Open command prompt
- Type
pg_restore -U username -d dbname -1 filename.dump
(Replace username with your username for postgres, replace dbname with civitas first, run the command a second time for the django database, replace filename.dump with the location of the sql scripts).
- Open command prompt
- cd to the root location of your Civitas installation
- Run the command
.\manage.exe runserver_plus --noreload
- The above should give a clear error message as to what went wrong
- Open up file explorer and navigate to where you installed My Civitas
- Navigate to the folder
\core\settings
- Copy the file called
secret.py
- Paste the file in the following folder
\lib\core\settings
- Restart the app
- Open up file explorer and navigate to where you installed My Civitas
- Navigate to the folder
\lib\core\settings
- Open the text document called
db.text
with adminastrator privileges (Notepad++ is a handy tool) - Update your username and password for the civitas and django database
- Restart the app
- Update the username and password for the databases using psql/pgAdmin with the information your disturbutor has given you for the exe