Welcome to poznaj-backend’s documentation!

Introduction

This is documentation for the poznaj-backend project. It is made with help of Koduj Dla Polski Wrocław and Klub Jagieloński we Wrocławiu.

Disclaimer

This project is a work in progress

Technology stack

  • Ubuntu OS for server (thanks to Heroku)
  • Python and pip
  • Dependencies, listed below

Dependencies

  • PostgreSQL database
  • Django 1.10 as a framework of choice
  • Docker + Docker compose for local development
  • Python >=3.5

Documentation Contents:

Installation instructions

Clone the repository

Using the console, navigate to the root directory in which your projects live and clone this project’s repository:

$ git clone git@github.com:kj-wroclaw/poznaj-backend.git
$ cd poznaj-backend

You may also wish to fork the repository on GitHub and clone the resultant personal fork. This is advised if you are going to be doing development on poznaj-backend and contributing to the project.

There are two ways to install poznaj-backend:

It is recommended to use docker for local development.

Stand-alone installation

These instructions are specific to Ubuntu Linux but will be similar for other UNIX-based systems.

  1. Install PostgreSQL:
$ sudo apt-get update
$ sudo apt-get install postgresql postgresql-contrib
  1. Create database and user:
$ su - postgres
$ psql
  1. Install virtualenv to be able to create a local environment for your server:
$ pip install virtualenv
  1. Create your virtual environment:
$ virtualenv -p /usr/bin/python3 ~/.virtualenvs/poznaj-backend

Make sure that you have python 3 installed as we are using this version.

  1. Activate your environment:
$ source ~/.virtualenvs/poznaj-backend/bin/activate
  1. Install local and test requirements:
(poznaj-backend) $ pip install -r requirements/local.txt
(poznaj-backend) $ pip install -r requirements/test.txt
  1. Install autoenv and put there:
$ cat .env
DATABASE_URL=postgres://poznaj:poznaj@localhost:5432/poznajdb
  1. Then run server via:
(poznaj-backend) $ python manage.py migrate
(poznaj-backend) $ python manage.py runserver
  1. To run tests use
(poznaj-backend) $ pip install tox
(poznaj-backend) $ tox

Docker-based installation

We are using docker and docker compose to develop code locally. Before you run any commands below please make sure that you have docker installed via this instructions. As you have installed docker install docker-compose

(poznaj-backend)$ pip install docker-compose

After this setup you are ready to go! First run application:

$ make build
$ make run

Then make migrations:

$ make make-migrations

And migrate:

$ make migrate

To create superuser use:

$ docker-compose run django python manage.py createsuperuser

To run test (after you run make run) use:

$ make test

Contributing

We are always happy to get issues identified and pull requests!

Getting your pull request merged in

  • Keep it small. The smaller the pull request the more likely I’ll pull it in.
  • Pull requests that fix a current issue get priority for review.
  • If you’re not already in the docs/contributors.rst file, add yourself!

Installation + running the tests

Please refer to online documentation on how to install this project.

Code conventions

  • For python follow PEP8 with 120 line characters limit
  • For javascript follow airbnb
  • For html & css follow this codeguide

Contributors

Core Developers

These contributors have commit flags for the repository, and are able to accept and merge pull requests.

Name Github Twitter
Krzysztof Żuraw @krzysztofzuraw @krzysztof_zuraw

Changelog

All enhancements and patches to Poznaj backend will be documented in this file. This project adheres to Semantic Versioning.

v1.2.0 (2017-03-05)

  • Stories can be filtered by lat/long @krzysztofzuraw
  • Packages update via @pyup

v1.1.0 (2017-02-17)

  • Stories & Points APIs now contain ids instead of urls @krzysztofzuraw

v1.0.0 (2017-02-04)

  • Release 1.0.0 to heroku @krzysztofzuraw

v0.7.0 (2017-01-28)

  • Add basic auth @krzysztofzuraw

v0.6.0 (2016-12-31)

  • Add basic models: Images, Points & Stories @krzysztofzuraw

v0.5.0 (2016-10-27)

  • Fixing small errors in docs @krzysztofzuraw

v0.4.0 (2016-10-26)

  • Add various files for ease development @krzysztofzuraw

v0.3.0 (2016-10-25)

  • Add support for Travis CI @krzysztofzuraw

v0.2.0 (2016-10-24)

  • Add support for py.test and tox @krzysztofzuraw

v0.1.0 (2016-10-20)

  • Add support for docker and docker compose @krzysztofzuraw

Indices and tables