Skip to content

cern-sis/cern-academic-training

Repository files navigation

Installation

Prerequisite

pre-commit

Install pre-commit and afterwards run:

$ pre-commit install

poetry

Install poetry.

Backend

$ cd backend
$ poetry install

UI

$ cd ui
$ yarn install

Run the project

Backend

cd backend
docker-compose up -d
poetry install
python manage.py migrate
python manage.py opensearch index rebuild
python manage.py opensearch document index
python manage.py runserver

Add users

Adding a super admin user username: admin password: 123456

$ python manage.py loaddata users.json

Add data

python manage.py loaddata lectures.json
python manage.py opensearch index rebuild
python manage.py opensearch document index

UI

$ cd ui
$ yarn install
$ yarn start

Harvest CDS

Harvest a specific date

$ cd harvest
$ poetry install
$ scrapy crawl CDS -a "from_date=2021-09-01"

Harvest all lectures up until now

$ cd harvest
$ poetry install
$ scrapy crawl CDS -a "migrate_all=True"