Skip to content
No description, website, or topics provided.
Branch: dev
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs wrong path Apr 8, 2018
etc
ipt_connect
.gitignore More temp files to .gitignore Mar 26, 2019
Dockerfile
LICENSE adding a license. Closed #39 Apr 8, 2018
README.md README: note on CSV import Apr 2, 2019
compose-nginx.yml Added docker-compose for nginx Nov 12, 2018
compose-without-nginx.yml
docker-compose.yml
entrypoint.sh Added docker-compose for nginx Nov 12, 2018
requirements.txt Dockerized Nov 12, 2018

README.md

ipt_connect

A python/django web-based interface to track the grades, compute the rankings and display a lot of interesting statistics on the International Physicists' Tournament.

Status

  • Code: working, v2.0, minor display bugs to fix
  • Documentation: work in progress
  • CI: None

readthedocs

How to use

With Docker

Development

This image runs standard Django web server.

Production without nginx

If you have any web server (for example nginx) on your machine you can use compose-without-nginx.yml. This image uses gunicorn as WSGI server and places ipt_connect.sock file into ipt_connect directory. Configure your web server to work with it. You can see configuration example for nginx here. Don't forget to review your project settings, see deployment checklist for more information.

Production with nginx

If you haven't any web server you can use compose-nginx.yml. This image runs ipt_connect with nginx and automatically installs Let's Encrypt certificate.

  • Open compose-nginx.yml and change things:
    • Set timezone to your local, for example TZ=UTC. For more timezone values check /usr/share/zoneinfo directory.
    • LE_EMAIL should be your email and LE_FQDN should be your site domain.
  • Replace www.example.com in service.conf by your domain.
  • Don't forget to review your project settings, see deployment checklist for more information.

Without Docker

Not recommended way!

  • Install the requirements pip install -r requirements.txt
  • Run python manage.py runserver
  • Open 127.0.0.1:8000/IPTdev/

F.A.Q:

How to add superuser and sign in to site?

  • Run python manage.py createsuperuser
  • Set username, email address and password.
  • Run python manage.py runserver
  • Open 127.0.0.1:8000/admin/ and sign in.

How to switch between languages?

Сhange LANGUAGE_CODE values in this file to switch the language. Available values:

  • en-us
  • ru

I added new text to the template. How сan I update language files?

Run python manage.py makemessages -a -e=html -i=grappelli/*

How to compile language files?

Language files are compiled automatically when the server starts.

How to add a new language?

  • Run python manage.py makemessages -l de -e=html -i=grappelli/* where de is the locale name for the message file you want to create.
  • Translate all text in the file, which will be create.
  • Run application.

How to start a new tournament?

  • Run python manage.py flush
  • Sign in as superuser and add new participants, jury members and etc.

This command just deletes all the data of current tournament(s). If you want to start a new tournament in adition to existent, read below.

What if I have the list of participants somewhere else?

Then you can avoid inserting the participants and jurors by hand. Log in as superuser and navigate to http://127.0.0.1:8000/IPTdev/upload_csv/. Select a CSV file and click Upload. Note that the format of CSV file is hardcoded in views.py. Don't hesitate to adjust it for your needs!

How to add (clone) a tournament?

./clone-instance.sh IPTdev IPT2019 IPTdev is the name of existing instance. IPT2019 is the name of instance to be created.

Look to the commits being done to see the details.

There are three main parts of the new tournament:

  • IPT2019 folder with the code
  • Records in ipt_connect/urls.py and ipt_connect/settings.py
  • Tables in the database

If you are deploying an instance, which you created locally, to the remote server - then you have to do the required steps manually. Just create the instance locally and look at the commits which wil be created.

Notice: this clones only structure of the tournament, i.e. you have an empty table for teams, no registered jurors, etc.

You can’t perform that action at this time.