Giter VIP home page Giter VIP logo

openstreetmap-calendar's Introduction

OpenStreetMap Calendar

A simple calendar for tracking OpenStreetMap-related activities.

Principles

  • Less, but better.
  • Work hard and be nice to people.

User Documentation

Please look at OpenStreetMap Calendar Documentation for information about integration and API.

Developer Documentation

This is a Django application, it uses poetry for managing dependencies. Please look at their documentation for installation instructions.

We support Python ≥ 3.8 and PostgreSQL ≥ 10.

Database

You need a running PostgreSQL database. There are two options: Running it locally or using Docker.

A) Local Installation

Create a PostgreSQL user called osmcal and a database osmcal with the owner set to osmcal. E.g.

CREATE ROLE osmcal WITH LOGIN ENCRYPTED PASSWORD 'postgres';
CREATE DATABASE osmcal OWNER osmcal;
CREATE EXTENSION postgis;

Make sure you have following line in your pg_hba.conf, so osmcal need a password to log in:

local    all    all        trust

Alternatively, you can set your DB password using the POSTGRES_PASSWORD environment variable, c.f. the following section on Docker.

B) Docker

docker run -e POSTGRES_DB='osmcal' -e POSTGRES_USER='osmcal' -e POSTGRES_PASSWORD='postgres' --name osmcaldb postgis/postgis

Note: You can use docker start osmcaldb and docker stop osmcaldb after first run of the command above.

When using database in docker with the command above, the database host is:

export OSMCAL_PG_HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' osmcaldb)

and database password is:

export OSMCAL_PG_PASSWORD='postgres'

Virtual Environment

Use poetry to create a virtual environment. Then, install the dependencies:

cd openstreetmap-calendar
poetry install

Running Tests

poetry run ./manage.py test

Developer Server

In order to facilitate testing, you can use a fake login locally without having to setup OAuth first. To do this, scroll down to the footer. In debug mode, there is a link called "Mock login" which will instantly log you in as a normal user.

To prepare for application launch run the database migrations:

poetry run ./manage.py migrate

and then the local server:

poetry run ./manage.py runserver

If you need test data, you can load some using:

poetry run ./manage.py loaddata osmcal/fixtures/demo.yaml

API Documentation

The API is described using OpenAPI 3, the schema is located in /api/schema/. The currently live version is visible here.

OAuth Setup

If want to test the OAuth flow, you need to create an OAuth app first:

  1. Go to osm.org -> My Settings -> oauth settings -> bottom of the page (My Client Applications) -> Register your application.
  2. Fill Name and Main Application URL. No restrictions here.
  3. You must fill Callback URL with http://localhost:8000/oauth/callback.
  4. Mark read their user preferences.
  5. Click Register.

When the application is registered on osm.org, set the respective environment variables used for oauth and copy Consumer Key and Consumer Secret:

export OSMCAL_OSM_KEY='...'
export OSMCAL_OSM_SECRET='...'

openstreetmap-calendar's People

Contributors

thomersch avatar dependabot[bot] avatar danieldegroot2 avatar saerdnaer avatar mvexel avatar pietervdvn avatar

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.