Go to file
Kiara Grouwstra 48b7581c69 document user creation 2022-01-03 20:49:39 +01:00
api react project build within django 2021-11-24 00:06:46 +01:00
backend docker compose does something? 2022-01-03 20:24:36 +01:00
data docker compose (wip) 2022-01-02 21:54:34 +01:00
sql docker compose (wip) 2022-01-02 21:54:34 +01:00
.DS_Store react project build within django 2021-11-24 00:06:46 +01:00
.gitignore ditch .idea from version control 2021-08-29 19:15:48 +02:00
README.md document user creation 2022-01-03 20:49:39 +01:00
docker-compose.yml actually expose docker server 2022-01-03 20:40:50 +01:00
manage.py new first commit 2021-08-26 15:34:15 +02:00
requirements.txt attempt to reproduce running the app attempt to reproduce running the app 2021-08-29 00:21:09 +02:00

README.md

BIJ1 flyer app back-end

Prepare config file

cp backend/configs/mysql.txt backend/configs/mysql.cnf

Usage

Requirements:

Run the following commands, given a running MySQL:

# tell django to use the local db
cp backend/configs/mysql.cnf backend/configs/mysql.django.cnf
# populate the database
mysql -uroot --password=password bij1 < /scripts/dump.sql
# create a virtual environment
python3 -m venv ./env
# active the virtual env
source ./env/bin/activate
# install python dependencies
pip install -r requirements.txt
# prepare the database
python manage.py migrate
# create user
python manage.py createsuperuser
# run the application
python manage.py runserver

Usage by Docker

Requirements:

# tell django to use the docker db
sed 's/127.0.0.1/db/g' backend/configs/mysql.cnf > backend/configs/mysql.django.cnf
# boot the application
docker compose up
# populate the database
docker exec -it $(docker compose ps db --format json | jq '.[].Name' | sed -n 's/"//pg') /bin/bash -c 'mysql -uroot --password=password bij1 < /scripts/dump.sql'
# create user
docker exec -it $(docker compose ps python --format json | jq '.[].Name' | sed -n 's/"//pg') /bin/bash -c 'cd /app; python manage.py createsuperuser'

Data sources