Skip to content

City-of-Turku/mpbackend

Repository files navigation

Mobility Profile Backend

This is the backend for the Mobility Profile

Installation with Docker Compose

First configure development environment settings as stated in config_dev.env.example.

Running the application

Run application with docker-compose up This will startup and bind local postgres and mobilityprofile backend.

Runnig the application in production

docker-compose -f docker-compose.yml -f docker-compose.prod.yml up

Importing questions

To import questions run: docker-compose run mpbackend import_questions

Installation without Docker

First, install the necessary Debian packages. TODO, add packages.

  1. Clone the repository.
git clone https://github.com/City-of-Turku/mpbackend.git
  1. Install python 3.10 and pip requiremends Be sure to load the environment before installing the requirements.
pip install pip-tools
pip install -r requirements.txt
  1. Setup the PostGIS database.

Please note, we recommend PostgreSQL version 13 or higher. Local setup:

sudo su postgres
createuser -RSPd mobilityprofile
createdb -O mobilityprofile -l fi_FI.UTF-8 -E utf8 mobilityprofile
  1. Create database tables.
./manage.py migrate
  1. Import questions
./manage.py import_questions
  1. Install Memcached
sudo apt update
sudo apt install memcached