Skip to content
This repository has been archived by the owner on Aug 22, 2018. It is now read-only.

Latest commit

 

History

History
104 lines (73 loc) · 2.14 KB

CONTRIBUTING.md

File metadata and controls

104 lines (73 loc) · 2.14 KB

Development

To set up your development environment:

Install Python

Install PostgreSQL

Installation varies by platform.

Once installed, the pg_config executable must be on your PATH. Setup varies by platform; here are instructions for Postgres.app

Use virtualenv

cd baker-street/
pip install virtualenv
virtualenv venv
source venv/bin/activate

Install dependencies

pip install -r requirements.txt

Install NLTK data

python -m nltk.downloader all

Create the database and set DATABASE_URL

psql --command="CREATE DATABASE baker_street_development;"
export DATABASE_URL="postgresql://localhost/baker_street_development"

Migrate the database

./manage.py migrate

Load CanLII seed data

./load_canlii_documents.sh

Start Django

./manage.py runserver

Start worker

celery -A baker_street worker -l info

Create an OAuth application for the Chrome Extension

  • Open http://localhost:8000/o/applications/register
  • Fill out the form:
    • Name: sherlocke-chrome-dev
    • Client id: sherlocke-chrome-dev
    • Client secret: (leave default)
    • Client type: Confidential
    • Authorization grant type: Implicit
    • Redirect uris: https://<extension-id>.chromiumapp.org/provider_cb where <extension-id> is the Sherlocke extension ID from chrome://extensions/

Deploying

We're using Dokku Alternative on Amazon Web Services. First contact @elliottsj to add your public key to the server, then add the remote and push to deploy:

git remote add dokku dokku@sherlocke.me:sherlocke.me
git push dokku

To proxy requests from http://sherlocke.me to http://baker-street.sherlocke.me, add /etc/nginx/conf.d/www.conf:

server {
  server_name sherlocke.me;

  location / {
    proxy_pass http://baker-street.sherlocke.me;
  }
}