Skip to content
Create teams automatically based on discrete scores of the players
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Codeship Status for Nagasaki45/Xteams Coverage Status

You want to create teams, but:

  • How can one create teams when Dana doesn't want to play with Haim, who must play with Jacob but not with Yossi... You've got the idea.

  • No one will ever want to help in creating teams as he may end up insulting a not-so-good player by choosing him last.

  • Maybe you have too many players around for one game, but just enough for a tournament of 4 teams.

Xteams aim to solve these issues with one goal in mind:

Create teams automatically based on discrete scores of the players

Using Xteams, group managers can give scores to players in the management panel. Players of the group can't access this panel but can see the list of players, mark which of them arrived to the game and create teams easily.


Instead of global postgres installation I'm using postgres in a docker container in development. So make sure you have docker and docker-compose available on your dev machine.

First, run the initial requirements and local database setup:

$ # virtualenv is highly recommended
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements/run.txt
$ docker-compose up -d  # to spin postgres
$ python migrate

You are ready to go, run:

$ python createsuperuser  # optionally
$ python runserver

Requirements files

There are 3 requirements files:

  • For running the app you only need to pip install requirements/run.txt
  • For running the tests and CI/CD you will also have to pip install requirements/extra.txt
  • I'm using one more requirement file for development, but nothing really depends on it.


Secrets are kept in a file in the root directory of the project, named env_file. Create one and populate it with:

ADMIN=<Your name>
ADMIN_EMAIL=<Your email>

docker-compose will use this env_file automatically (notice the format, there are no exports). Although it's possible to run without it in development, you probably want to export each line. If you use some kind of autoenv the .env file will export each line for you. Otherwise you can source the .env file manually, or export manually, as you prefer.

Production / staging

Note that fab deploy and fab stage automates most of the following.

Run the production environment on port 9768 (random number, to allow multiple apps on the same server) with:

$ docker-compose -f docker-compose-prod.yml build
$ docker-compose -f docker-compose-prod.yml run --rm web python migrate
$ docker-compose -f docker-compose-prod.yml up -d

It will build 2 docker containers, web and db.

You can set the Nginx on the host to route traffic to the web container with:

# /etc/nginx/sites-available/

server {
    listen 80;

    location / {
        proxy_set_header Host;
        proxy_pass http://localhost:9768;

Add a link to sites-enabled:

ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Restart your host Nginx with service nginx restart.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.