Refresh existing dev environment¶
Document owner: Harrison Leong (@leong96)
Are you working on this project, but afraid you messed something up? This page explains how to do a full reset and start with a fresh environment:
Create a fresh environment¶
- Make sure the application is stopped (
docker-compose down
). - Delete the database Docker volume (
docker volume rm django-rit-grasa_djangograsa_db
). - Make a copy of
config.yml.example
and name itconfig.yml
. - Rebuild the project containers and start the app (
docker-compose up --build
). - In a separate shell window, run
docker ps
, which shows all running containers. They should be mariadb and django-rit-grasa.- If for some reason, they are not both there, use
docker ps -a
to get the name of the list of all containers, including the non running ones, thendocker start [containerID]
to start them.
- If for some reason, they are not both there, use
- Run the command
docker exec -it [containerID for the django container] /bin/bash
. - Run
python3 manage.py migrate
- Run
python3 manage.py rebuild_index
- Visit localhost:8000 in a browser
Initial app configuration¶
These directions only apply to local development. See the Admin Quickstart for a production deployment.
- Visit localhost:8000/admin_user
- Visit localhost:8000/create_database
- Site is now usable with the following admin account:
- Username:
grasatest@yahoo.com
- Password:
Password1
- Username:
Note that the MySQL/MariaDB container is started automatically with a grasa_event_locator
database, but this will not happen automatically in production.