Respa is a backend service for reserving and managing resources (e.g. meeting rooms, equipment, personnel). The open two-way REST API is interoperable with the 6Aika Resource reservation API specification created by the six largest cities in Finland. You can explore the API at api.hel.fi and view the API documentation at dev.hel.fi.
User interfaces for Respa developed for the City of Lappeenranta by Visma Solutions Oy is Varaamo. The City of Helsinki and Hämeenlinna have developed several UIs and backend on top of Respa.
There are two user interfaces for editing data: Admins may use the more powerful Django Admin UI - other users with less privileges may use the more restricted but easier-to-use and nicer-looking Respa Admin UI.
===================
virtualenv -p /usr/bin/python3 ~/.virtualenvs/
workon respa
Install all required packages with pip command:
pip install -r requirements.txt
sudo -u postgres createuser -L -R -S respa
sudo -u postgres psql -d template1 -c "create extension hstore;"
sudo -u postgres createdb -Orespa respa
sudo -u postgres psql respa -c "CREATE EXTENSION postgis;"
python manage.py migrate
python manage.py createsuperuser # etc...
python manage.py geo_import --municipalities finland
python manage.py geo_import --divisions helsinki
python manage.py resources_import --all tprek
python manage.py resources_import --all kirjastot
Ready to roll!
- Install PGSQL from http://get.enterprisedb.com/postgresql/postgresql-9.4.5-1-windows-x64.exe
- At the end of installation, agree to run Stack Builder and have it install the PostGIS bundle
- Install OSGeo4W64 from http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe
- The defaults should do
- Add the osgeo4w64 bin path to your PATH
- Failing to do this while setting
GEOS_LIBRARY_PATH
/GDAL_LIBRARY_PATH
will result in "Module not found" errors or similar, which can be annoying to track down.
- Failing to do this while setting
Respa supports synchronizing reservations with Exchange resource mailboxes (calendars). You can run the sync either manually through manage.py respa_exchange_download
, or you can set up a listener daemon with manage.py respa_exchange_listen_notifications
.
If you're using UWSGI, you can set up the listener as an attached daemon:
uwsgi:
attach-daemon2: cmd=/home/respa/run-exchange-sync.sh,pidfile=/home/respa/exchange_sync.pid,reloadsignal=15,touch=/home/respa/service_state/touch_to_reload
The helper script run-exchange-sync.sh
activates a virtualenv and starts the listener daemon:
#!/bin/sh
. $HOME/venv/bin/activate
cd $HOME/respa
./manage.py respa_exchange_listen_notifications --log-file=$HOME/logs/exchange_sync.log --pid-file=$HOME/exchange_sync.pid --daemonize
Respa uses the pytest test framework.
To run the test suite,
$ py.test .
should be enough.
$ py.test --cov-report html .
to generate a HTML coverage report.
This project uses two files for requirements. The workflow is as follows.
requirements.txt
is not edited manually, but is generated
with pip-compile
.
requirements.txt
always contains fully tested, pinned versions
of the requirements. requirements.in
contains the primary, unpinned
requirements of the project without their dependencies.
In production, deployments should always use requirements.txt
and the versions pinned therein. In development, new virtualenvs
and development environments should also be initialised using
requirements.txt
. pip-sync
will synchronize the active
virtualenv to match exactly the packages in requirements.txt
.
In development and testing, to update to the latest versions
of requirements, use the command pip-compile
. You can
use requires.io to monitor the
pinned versions for updates.
To remove a dependency, remove it from requirements.in
,
run pip-compile
and then pip-sync
. If everything works
as expected, commit the changes.