new reading environment for version 5.0 of the Perseus Digital Library
Clone or download
paltman Merge pull request #322 from scaife-viewer/enable-non-root-hosting
Add support for hosting at a path other than root
Latest commit 6f51619 Jan 8, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Some clean up Jan 7, 2019
bin switch to Mar 10, 2018
data initial library metadata from Alison Dec 24, 2017
fixtures use same site name for dev instance Mar 13, 2018
scaife_viewer Only do dict lookup once Dec 19, 2018
static/src Default base url should have a slash Dec 19, 2018
.babelrc WIP: Updates Dec 9, 2018
.buildpacks EC bits Sep 26, 2017
.dockerignore added Dockerfile Nov 8, 2017
.eslintignore added .eslintignore Sep 29, 2017
.eslintrc.json Some clean up Jan 7, 2019
.gitignore WIP: Updates Dec 9, 2018 Updating authors May 4, 2018 Create Mar 8, 2018
Dockerfile Some clean up Jan 7, 2019
LICENSE Some clean up Jan 7, 2019
Pipfile Upgrade to Python 3.7.1 Dec 11, 2018
Pipfile.lock Upgrade to Python 3.7.1 Dec 11, 2018
Procfile fixed preloading Nov 1, 2017 Add some instructions for hosting off-root Dec 19, 2018
cloudbuild-dev.yml fixed CB yaml Feb 9, 2018
cloudbuild-production.yml fixed CB yaml Feb 9, 2018
docker-compose.yml Add docker-compose.yml for running scaife-viewer server + PostgreSQL … Mar 12, 2018 Use `exec honcho start` web to ensure honcho and gunicorn correctly r… Mar 12, 2018
gondor.yml updated EC config for site move Mar 2, 2018 pinax start account Sep 22, 2017
package-lock.json Merge branch 'dev' into fix-pagination Dec 14, 2018
package.json Merge branch 'dev' into fix-pagination Dec 14, 2018
setup.cfg added quote checking Mar 13, 2018
webpack.config.js Add support for hosting at a path other than root Dec 18, 2018

Scaife Digital Library Viewer

The Scaife Viewer is the new reading environment for the Perseus Digital Library.

See Ways to Contribute.

Getting Started


  • Python 3.7.1
    • pipenv
  • Node 10.7
  • PostgreSQL 9.6
  • Elasticsearch 6

First, set up a database to use for local development:

createdb scaife-viewer

This assumes your local PostgreSQL is configured to allow your user to create databases. If this is not the case you might be able to create the user yourself:

createuser --username=postgres --superuser $(whoami)

Install the Node and Python dependencies:

npm install
pipenv install --dev

Setup the database:

pipenv run python migrate
pipenv run python loaddata sites

Seed the text inventory to speed up local development:

curl -s "" > ti.xml

You should now be set to run the static build pipeline and hot module reloading:

npm start

In another terminal, start runserver:

pipenv run python runserver

Browse to http://localhost:8000/.

Note that, although running Scaife locally, this is relying on the Nautilus server at to retrieve texts.


Before you work with translations, you will need gettext installed.


brew install gettext
export PATH="$PATH:$(brew --prefix gettext)/bin"

To prepare messages:

python makemessages --all

If you need to add a language; add it to LANGUAGES in and run:

python makemessages --locale <lang>

Hosting Off-Root

If you need to host at a place other than root, for example, if you need to have a proxy serve at some path off your domain like, you'll need to do the following:

  1. Set the environment variable, FORCE_SCRIPT_NAME to point to your script:
    export FORCE_SCRIPT_NAME=/perseus  # this front slash is important
  1. Make sure this is set prior to runing npm run build as well as prior to and part of your wsgi startup environment.

  2. Then, you just set your proxy to point to the location of where your wsgi server is running. For example, if you are running wsgi on port 8000 you can have this snippet inside your nginx config for the server:

    location /perseus/ {
        proxy_pass        http://localhost:8000/;

That should be all you need to do.