blob: 5176004d96b4e7062c03a68fe8636ab0a81d014a (
plain) (
blame)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
## Development installation
**CAVEATS**
THIS SYSTEM DOES NOT HANDLE CAF DATA. And it probably never will. There are
obvious security concerns with hosting sensitive aggregated data on anything
but the most secure systems. This project currently only manages the
management data involved with NIS compliance: it is a basic CRM/CRUD
application that handles contacts, events, etc.
There is, in the background, some facility to store CAF data, but this is not
currently brought out in the user interface. Find it in the admin interface.
---
To install `ctrack` to enable testing and development on your local machine
(Mac and Linux environment only).
You need to have `sudo` rights on the machine.
### Dependencies
* Python 3.8 or higher
* python3-venv (on Debian based distribution)
* git
I recommend SQLite or PostgreSQL for the database whilst testing. Current test
configuration uses PostgreSQL.
To install PostgreSQL on Debian-based distribution:
* `sudo apt update`
* `sudo apt install postgresql`
* `sudo apt install python3-venv`
You will probably need to start the database server with `sudo pg_ctlcluster 11 main
start`.
If you use SQLite, you will need to change the configuration in
`ctrack.config.settings.gcloud_settings`.
### Django set up
Get the code:
* `git clone https://github.com/yulqen/ctrack`
* `cd ctrack`
Create and activate a new virtual environment:
* `python3 -m venv .venv`
* `source .venv/bin/activate`
Install Django and python dependencies:
* `pip install -r requirments.txt`
Set up the ctrack database:
* `sudo -u postgres psql postgres`
* `CREATE DATABASE ctrack;`
* `ALTER ROLE postgres WITH PASSWORD 'postgres;'`
* `\q` (to quit `psql`)`
Note - never use this default username/password configuration on a production
server! This is for testing only.
Migrate:
* `python manage.py migrate`
Create a superuser:
* `python manage.py createsuperuser`
Run tests (optional, and there will be some failures):
* `pytest -k "not test_functional"`
If you want dummy data to play with:
* `python manage.py populate_db`
Run server:
* `python manage.py runserver`
|