Webová platforma na zabezpečenie chodu jednodňových súžaží organizovaných združením STROM.
- Python (3 or later, version 3.10.0 recommended)
- Django (version 4.2)
- virtual enviroment
Install Python from https://www.python.org/downloads/ and then in CMD type:
python -m pip install virtualenv
In Bash type:
sudo apt install pip
python3 -m pip install virtualenv
You have to get through local setup only once (per a project).
In CMD:
Create virtual enviroment
py -m venv ENV_NAME
where ENV_NAME
is your desired name for the newly created virtual environment, e. g. venv
.
Perhaps, you will need to allow remote access in your firewall.
In Terminal:
Create virtual enviroment
virtualenv ENV_NAME
Install dependencies:
pip install -r requirements.txt
and allow remote access for desired PORT_NUMBER
(e. g. 8080):
iptables -I INPUT -p tcp -m tcp --dport PORT_NUMBER -j ACCEPT
Make and then apply migrations. You can do it by typing:
manage.py makemigrations competition
manage.py migrate
to your CMD or Bash into sutazeStrom
directory.
In CMD:
- Go to
sutazeStrom
directory - Activate your virtual environment:
ENV_NAME\Scripts\activate
- Run server on your desired port:
python manage.py runserver 0.0.0.0:PORT_NUMBER
- Login as root user
In Terminal:
- Go to
sutazeStrom
directory - Activate your virtual environment:
source ENV_NAME/bin/activate
- Run server on your desired port:
python manage.py runserver 0.0.0.0:PORT_NUMBER
After all that you can access to admin site by typing localhost:PORT_NUMBER/admin
and to app by typing localhost:PORT_NUMBER/index
(localhost
can be substituted by an IP address of server e.g. 192.168.1.47
).