The information in the main table is automatically generated by parsing gr-recipes and gr-etcetera (PyBOMBS recipes).
- clone this repo
- install docker
- rename settings_secret.py.template to settings_secret.py and change the value of the secret key to something else (anything else)
- create a cronjob on the server running the docker container
crontab -e
0 1 * * * docker exec -ti cgran_cgran_web_1 /bin/sh -c "python manage.py refresh"
- To run locally for dev-
- in settings.py swap the DATABASES to the commented out one, and set ALLOWED_HOSTS = ['*']
- python manage.py migrate
- python manage.py makemigrations
- python manage.py migrate
- python manage.py refresh
- python manage.py runserver
- open browser to http://127.0.0.1:8000
docker-compose up --build --no-deps
or
docker-compose up
Refresh database with: python manage.py refresh
- For shell accessing-
docker exec -ti nginx bash
ordocker exec -ti web bash
docker ps
lists docker containers that are runningdocker ps -a
lists all built containers- you can stop and remove all docker containers using
docker stop $(docker ps -a -q)
thendocker rm $(docker ps -a -q)
- three-step guide to making model changes:
- Change your models (in models.py).
- Run python manage.py makemigrations to create migrations for those changes
- Run python manage.py migrate to apply those changes to the database.
- save db to yaml file-
python manage.py dumpdata --format yaml ootlist.Outoftreemodule -o db.yaml
- load yaml file to db-
python manage.py loaddata db.yaml