ojuso-map/README.md

118 lines
2.5 KiB
Markdown
Raw Normal View History

[![Translation](http://translate.ojuso.org/widgets/platform/-/svg-badge.svg)](http://translate.ojuso.org/engage/platform/?utm_source=widget)
[![pipeline status](https://gitlab.com/autonomic-cooperative/ojuso-map/badges/master/pipeline.svg)](https://gitlab.com/autonomic-cooperative/ojuso-map/commits/master)
[![coverage report](https://gitlab.com/autonomic-cooperative/ojuso-map/badges/master/coverage.svg)](https://gitlab.com/autonomic-cooperative/ojuso-map/commits/master)
# ojuso-map
2017-05-18 15:20:15 +00:00
Kickass map for the Ojuso Project
2018-04-08 20:22:31 +00:00
# Getting Started
2018-09-05 15:33:25 +00:00
## Check out the code
```bash
$ git clone git@gitlab.com:autonomic-cooperative/ojuso-map.git
$ cd ojuso-map
```
All commands from here on should be run in the `ojuso-map` directory.
## Install System Dependencies
2018-04-08 20:22:31 +00:00
2018-09-05 15:33:25 +00:00
### Debian / Ubuntu
2018-04-08 20:22:31 +00:00
```bash
2018-09-05 15:33:25 +00:00
$ xargs < system-requirements-debian.txt sudo apt-get install -y
2018-04-08 20:22:31 +00:00
```
### Fedora
```bash
2018-09-05 15:33:25 +00:00
$ xargs < system-requirements-fedora.txt sudo dnf install
```
If you hadn't previously installed Postgres, you will need to initialise the
database and start the server:
```bash
$
```
## Bootstrap the Virtual Environment
2018-09-05 15:33:25 +00:00
Set up your Python virtual environment in the `.venv` folder:
```bash
$ python3 -m venv .venv
2018-09-05 15:33:25 +00:00
$ source .venv/bin/activate
```
## Configure the Environment
```bash
$ export DEBUG=1
$ export DJANGO_SETTINGS_MODULE=ojusomap.settings
```
## Install the Python Dependencies
```bash
2018-09-05 15:33:25 +00:00
$ pip3 install --upgrade pip setuptools
2018-04-23 05:15:33 +00:00
$ pip3 install -r requirements-devel.txt
```
If you run into issues with `psycopg2` you may need to run the following:
```bash
2018-04-23 05:15:33 +00:00
$ pip3 uninstall psycopg2 && pip3 install --no-binary :all: psycopg2
```
2018-09-05 15:33:25 +00:00
## Ensure Postgres is running and accessible
You should be able to connect to Postgres:
```bash
$ psql -U postgres -h localhost
```
(enter "postgres" as the password)
If not, follow [these instructions](https://stackoverflow.com/a/51872624/399367)
to change the Postgres authentication options (NB on Fedora / Centos,
`pg_hba.conf` is located in `/var/lib/pgsql/data`), then run:
2018-09-05 15:33:25 +00:00
```bash
$ echo "ALTER USER postgres WITH PASSWORD 'postgres';" | psql -U postgres
```
2018-09-05 15:33:25 +00:00
## Run The Migrations
```bash
2018-04-12 19:47:40 +00:00
$ python manage.py migrate
```
2018-09-05 15:33:25 +00:00
## Start the server
```bash
$ python manage.py runserver
```
# Resuming work
2018-09-05 15:33:25 +00:00
For each new terminal session, you will need to run:
```bash
$ cd ojuso-map
$ source .venv/bin/activate
$ export DEBUG=1
$ export DJANGO_SETTINGS_MODULE=ojusomap.settings
$ python manage.py runserver
```
# Running The Tests
```bash
$ pip install -r requirements-test.txt
$ pytest -v
```