gnuradio / cgran

cgran.org Django website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is the Django web app for CGRAN.org

The information in the main table is automatically generated by parsing gr-recipes and gr-etcetera (PyBOMBS recipes).

To Install

  • 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
    1. crontab -e
    2. 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

To launch app with docker

docker-compose up --build --no-deps

or

docker-compose up

Refresh database with: python manage.py refresh

Tips/tricks

  • For shell accessing- docker exec -ti nginx bash or docker exec -ti web bash
  • docker ps lists docker containers that are running
  • docker ps -a lists all built containers
  • you can stop and remove all docker containers using docker stop $(docker ps -a -q) then docker rm $(docker ps -a -q)
  • three-step guide to making model changes:
    1. Change your models (in models.py).
    2. Run python manage.py makemigrations to create migrations for those changes
    3. 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

About

cgran.org Django website


Languages

Language:Python 78.7%Language:HTML 20.0%Language:Dockerfile 0.7%Language:CSS 0.7%