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.
For Contributor's Guide, see CONTRIBUTING.md.
- Code: working, v2.0, minor display bugs to fix
- Documentation: work in progress
- CI: None
This image runs standard Django web server.
- Run
docker-compose up
- Open 127.0.0.1:8000/IPTdev/
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.
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 andLE_FQDN
should be your site domain.
- Set timezone to your local, for example
- Replace
www.example.com
in service.conf by your domain. - Don't forget to review your project settings, see deployment checklist for more information.
Not recommended way!
- Install the requirements
pip install -r requirements.txt
- Run
python manage.py runserver
- Open 127.0.0.1:8000/IPTdev/
- Run
python manage.py runserver
- Open 127.0.0.1:8000/admin/ and # with
admin
as user and password.
- Run
python manage.py createsuperuser
- Set username, email address and password.
- Run
python manage.py runserver
- Open 127.0.0.1:8000/admin/ and #.
Сhange LANGUAGE_CODE
values in this file to switch the language.
Available values:
- en-us
- ru
Run python manage.py makemessages -a -e=html -i=grappelli/*
Language files are compiled automatically when the server starts.
- Run
python manage.py makemessages -l de -e=html -i=grappelli/*
wherede
is the locale name for the message file you want to create. - Translate all text in the file, which will be create.
- Run application.
- Run
python manage.py flush
- # 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.
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!
./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
andipt_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.
Until the proper CI is set, we use this simple tool
to check how changes in our python
code affect the real generated HTML code.
Dumper - utility for collect all pages
-
Install the requirements
pip install -r requirements.txt
-
To do dump:
- Run
python manage.py runserver
- Run
cd IPTdev/utils
- Run
python dumper.py
Path to dump will be printed into the terminal
- Run
-
Compare dumps:
- Using
diff -bBwEZ ...
- Using
meld
- Using your another favourite tool to find difference in HTML code :)
- Using
- Run
python manage.py test
Note: as for now (17 Jul 2020), there are some errors related to grappelli
and loginas
.
Just ignore them.
However, there should be no errors related to ipt_connect
itself.
- Run
python manage.py test IPTdev.utils.link_parser
The Internet is constantly changing, new files and pages appear, and old ones are deleted. And links can change their address. Broken links can damage the site. An internal link may not work due to erroneous address or removed/non-existing page. Finally, no one is safe from errors of programmers or administrators. Each dead link causes negative reaction from users. This utility crawls all the mentioned links and returns the list of non-working ones.