GithubHelp home page GithubHelp logo

polyachenkoya / issue-reporting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 6aika/issue-reporting

0.0 1.0 0.0 4.76 MB

Reference Open311 API server implementation

License: MIT License

Dockerfile 0.39% Python 81.94% JavaScript 13.02% CSS 0.16% HTML 4.49%

issue-reporting's Introduction

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

  • Python 3.3+
    • Python 2.7 is mostly supported, but Python 3 is recommended
  • Any database supported by Django. PostgreSQL with the PostGIS extension is preferrable.
    • Non-GIS-enabled databases will work too, but with degraded performance and/or capabilities.

Usage as a standalone project

Setup

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

  • Set up a Python 3 virtualenv
  • pip install -e requirements.txt in the virtualenv
  • Set up a database
  • Run using your favorite Python application server

Configuration

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

  • DEBUG: enable debug/development mode and set sane development defaults.
  • SECRET_KEY: the Django secret key. Must be set when not DEBUGging.
  • DATABASE_URL: an URL pointing to the SQL database for the project.
  • LANGUAGES: a comma-separated list of ISO 639-1 language codes to enable. Defaults to en,fi
  • MEDIA_ROOT: The root filesystem directory for media uploads
  • STATIC_ROOT: The root filesystem directory where static files are gathered into

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

Development

  • Install dependencies from both requirements.txt and requirements-dev.txt.
  • If the DEBUG envvar is truthy, sane development defaults are automatically inferred.
  • Use pip-tools to manage the two requirements files.

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

  • ISSUES_DEFAULT_MODERATION_STATUS: Set to unmoderated to set newly created issues as unmoderated, which makes them not appear in lists before set to public.
  • ISSUES_GEOMETRY_SRID: The SRID to use for the geometry fields in issues_geometry. Defaults to 4326 (WGS84).

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.