The new Django application for the Prosopography of the Byzantine World (PBW).
This is the repository for Prosopography of the Byzantine World, currently maintained by King's Digital Lab.
This project has been redesigned to run in a Docker container, aimed at an Openstack deployment.
- Django 3.2.5
- JQuery
- MySQL 5.7
- django-haystack 3.1.1
- Elasticsearch 7.1
- nginx-proxy: This is the primary entry point for the stack, running on 80. It automatically builds a proxy to other containers.
- django 3.2: The main container for the project (see more detailed description below.)
- nginx: This is the static data container, serving Django's static content.
- db: The database container for Django above, running a legacy version of MySQL (5.7).
- elasticsearch 7.10: The indexing container, used by Haystack 3.2.1. (Pre-migration, Haystack 2 was using Solr 6.)
The compose file will look for deployment variables in a compose/.env file. Below is a sample file:
#Django
DJANGO_READ_DOT_ENV_FILE=True
DJANGO_ALLOWED_HOSTS=
DJANGO_SECRET_KEY=
DJANGO_DEBUG=False
# Elasticsearch
# ------------------------------------------------------------------------------
discovery.type=single-node
# MySQL
# ------------------------------------------------------------------------------
DATABASE_URL=
MYSQL_ROOT_PASSWORD=
MYSQL_DATABASE=
MYSQL_USER=
MYSQL_PASSWORD=
MYSQL_HOST=db
Fill in the database credentials and Django variables. If deploying via a CI pipeling such as Gitlab, this file will need to be included in its variables (in the KDL setup, we encode this in base64 and add it to the CI/CD variables in the repository settings.)
- Enter the project directory:
cd pbw-django
- Build and run the docker containers
docker compose -f compose/docker-compose.yml up -d --build
- Copy mysql data into the db container and ingest it via the command line if necessary.
- Haystack indexes are not buit during the build process. To build the Haystack search indexes, first log into the django container
docker compose -f compose/docker-compose.yml exec django bash
. Then run the update_index management command:python manage.py update_index
You can access the site locally at http://localhost