/
Development Setup

Development Setup

Follow the steps below to get an instance of JARS up and running for testing/development.

Get Python 2.7

Head over to Python.org if you don't know where to start. Python 3.x is not supported.

Clone the Github repository

git clone https://github.com/diging/amphora.git
cd amphora

Set up a new virtual environment

Using a virtual environment is a pretty good idea, especially since JARS will need specific versions of packages that may be older than the ones you have installed on your system. We suggest using virtualenvwrapper or virtualenv.

Install system dependencies

We're working on this list. Don't be surprised if you see complaints about missing packages, either when installing Python packages (below), or running the dev server. Sorry, we'll get to this eventually.

  • Postgres >= 9.4 (older might be fine)
    • Sqlite will work for most things, but you may see odd behaviors for more complex queries.
  • Redis (for asynchronous tasks)
  • libmagic

Install Python dependencies

Dependencies can be found in ``jars/requirements.txt``. We recommend using pip.

pip install -r requirements.txt

Note that you'll need to repeat this occasionally as the project progresses, since we'll add new dependencies from time to time.

Environment variables

Set the following variables in your environment:

export MEDIA_ROOT='/tmp/jars'
export STATIC_ROOT='path/to/static'
export DEVELOP='True'
export BACKEND=postgres
export DATABASE_URL=postgres://dbuser:dbpassword@localhost:5432/dbname
export GILES_APP_TOKEN=your_giles_token (ask Julia for that)
export SOCIAL_AUTH_GITHUB_KEY=github_key (create a new app on your Github profile)
export SOCIAL_AUTH_GITHUB_SECRET=github_secret

Setting DEVELOP='True' will turn DEBUG on, select the sqlite database backend, etc. 

Create media directory

JARS needs a place to put things. You should make sure that \{MEDIA_ROOT\} and \{MEDIA_ROOT\}/uploads both exist, and are writeable.

Migrate

python manage.py migrate

Load Schemas

JARS needs some metadata schemas before it can handle things like Zotero collections. There are several popular schemas bundled with JARS. To load them, run:

python manage.py load_schemas

Start the dev server

This is for development purposes only. 

python manage.py runserver

Related content

Amphora
Amphora
More like this
Setting up your computer (Python)
Setting up your computer (Python)
More like this
How to use virtual environments (Python)
How to use virtual environments (Python)
More like this
JupyterHub Workspace
JupyterHub Workspace
More like this
How to set up an account in Amphora
How to set up an account in Amphora
More like this