-
Clone this project:
git clone <GIT_URL>
-
Install python 3.12. We suggest using a virtual environment if you know how.
-
Install PostgreSQL and create a Database and a User who can access it
- If you use Docker, run:
docker run --name aiarena-web-postgres -p 5432:5432 -e POSTGRES_PASSWORD=aiarena -d postgres:15.5 docker exec -i aiarena-web-postgres psql -U postgres -c "create user aiarena with encrypted password 'aiarena' createdb" docker exec -i aiarena-web-postgres psql -U postgres -c "create database aiarena with owner aiarena" docker exec -i aiarena-web-postgres psql -U postgres -c "grant all privileges on database aiarena to aiarena"
- Otherwise, connect to your PostgreSQL installation with
psql -U postgres
and call:
create user aiarena with encrypted password 'aiarena' createdb; create database aiarena with owner aiarena; grant all privileges on database aiarena to aiarena;
-
Install python modules
pip install -r ./requirements.DEVELOPMENT.txt
-
Modify the Website config to use your Database.
If you are using a standard postgres setup at localhost:5432 and step 3's SQL script, then you can skip this step - the credentials will already be configured.
If you need to configure different credentials, make a copyaiarena-web/aiarena/settings/local_example.py
namedlocal.py
and you can modify the database settings there. -
Initialize Website DB. Set environment variable
DJANGO_ENVIRONMENT
toDEVELOPMENT
and then run:python manage.py migrate
-
Create static files
python manage.py collectstatic
-
Seed the database with data users and match data
python manage.py seed # Optional python manage.py generatestats
-
(Optional) Configure redis cache.
For most development purposes you can skip this step but note that any components that rely on redis may not work properly.- If you have Docker installed, it can easily be installed and run.
- Install Redis
docker pull redis
- Run Redis, this command uses Docker's port forwarding to let the django server access the container.
docker run --name aiarena-web-redis -p 6379:6379 -d redis
- Install Redis
- You can also install Redis on your machine by following the instructions here
- If you have Docker installed, it can easily be installed and run.
-
Launch the Website then navigate your browser to
http://127.0.0.1:8000/
python manage.py runserver
You can log into the website using the accounts below:
Admin user: username - devadmin, password - x.
Regular user: username - devuser, password - x.
Assuming you have run pip install -r ./requirements.DEVELOPMENT.txt
, you only need to run this to set up pre-commit linter checking.
pre-commit install