6aika / issue-reporting

Reference Open311 API server implementation
MIT License
7 stars 4 forks source link

Issue Reporting

License

Based on hep7agon/city-feedback-hub. Thanks!

Description

This project implements a civic issue reporting system with a GeoReport v2 API.

This repository may be used either as a standalone GeoReport V2 API server, or its components may be used as Django applications.

When installing via PyPI or setup.py, the standalone project is not available, but the Django applications are.

Requirements

Usage as a standalone project

Setup

The project is a regular Django project, so no thoroughly special steps should need to be taken.

Configuration

The cfh project is configured via environment variables, described below.

All of the Django settings described below are also available as equivalently named environment variables for the standalone project.

Development

Running tests

Py.test is used as the test runner. Just run py.test (with --cov for coverage)

Importing issues

You may wish to import some issues from a pre-existing GeoReport V2 server to test your installation against.

For instance, to use the City of Helsinki's palautews service for this, use Django's shell to:

from issues.sync.down import update_from_georeport_v2_url
update_from_georeport_v2_url("https://asiointi.hel.fi/palautews/rest/v1/requests.json")

Django settings

Try it out via Docker

For both of the below methods, do take note of the

===== SUPERUSER CREDENTIALS =====
#       Username: adminxxx      #
#       Password: xxxxxxxx      #
#################################

box that appears in the output. You will need those credentials to log in to the admin and add a Service or two.

Docker-Compose

A docker-compose.yml file is supplied that will start up a PostGIS-backed instance on localhost:8000.

Simply run

env SECRET_KEY=SOMETHING_UNIQUE_AND_SECRET_HERE docker-compose up

Plain ol' Docker

To quickly run an "evaluation" instance without GIS (using SQLite as the database backend, that is),

docker build -t cfh .
docker run -it -e DEBUG=1 -e DATABASE_URL=sqlite:////data/db.sqlite3 -P cfh