Powering openhumans.org
Clone or download
madprime Fix sources list during authorization
All sources that permission is being requested for should show up
in authorization, not merely sources that are active and approved.
Latest commit 5a7f67f Nov 9, 2018
Permalink
Failed to load latest commit information.
.github Update pull_request_template.md Nov 1, 2018
bin 🔥 remove deprecated syncdb command Feb 18, 2016
common Replace django-user-accounts with django-allauth (#873) Oct 1, 2018
data_import
docs
gulp
open_humans
private_sharing
public_data
scripts
static
.buildpacks Change buildpack order so node goes first Jul 30, 2014
.checkignore 👕 ignore migrations for style checks Feb 23, 2016
.coveragerc
.eslintrc
.gitignore
.jscsrc
.pydocstyle
.pylintrc
.scss-lint.yml
CODE_OF_CONDUCT.md
EXTERNALS.md
LICENSE.txt
Procfile
README.md Migrate to Python3 (#817) Jul 23, 2018
codecov.yml
dev-requirements.in Update requirements to fix testing errors Dec 1, 2017
dev-requirements.txt
env.example
gulpfile.js
manage.py
package.json
requirements.in
requirements.txt
runtime.txt

README.md

open-humans

Codeship Status for OpenHumans/open-humans codecov.io

This repository contains the code for the Open Humans Website.

The local development environment

dependencies

  • python >=3.5
  • pip3
  • virtualenv (pip3 install virtualenv)
  • nodejs 6.x
  • npm 3.x
  • libffi (apt-get install libffi-dev in Debian/Ubuntu or brew install libffi in OSX)
  • libpq (apt-get install libpq in Debian/Ubuntu or brew install libpq in OSX)
  • postgres (apt-get install libpq-dev python3-dev and apt-get install postgresql postgresql-contrib in Debian/Ubuntu)
  • memcached (apt-get install memcached libmemcached-dev or brew install memcached)
  • ChromeDriver for Selenium tests

virtualenv

For the following commands, you'll also want to set up virtualenvwrapper:

Create a virtualenv:

  • mkvirtualenv open-humans
  • pip3 install -r requirements.txt -r dev-requirements.txt

In the future, start the virtual environment with:

  • workon open-humans

And update it after pulling updated code by repeating:

  • pip3 install -r requirements.txt -r dev-requirements.txt

node.js dependencies (primarily for gulp)

  • npm install -g gulp
  • npm install

Update after pulling updated code by repeating:

  • npm install

create your postgres database

Running this site requires a PostgreSQL database (even for local development).

  • In Debian/Ubuntu
    • Become the postgres user: sudo su - postgres
    • Create a database (example name 'mydb'): createdb mydb
    • Create a user (example user 'jdoe'): createuser -P jdoe
    • Enter the password at prompt (example password: 'pa55wd')
    • run PostgreSQL command line: psql
      • Give this user privileges on this database, e.g.:
        GRANT ALL PRIVILEGES ON DATABASE mydb TO jdoe;
      • Also allow this user to create new databases (needed for running tests), e.g.:
        ALTER USER jdoe CREATEDB;
      • Quit: \q
    • Exit postgres user login: exit

Set up environment settings

Use env.example as a starting point. Copy this to .env and modify with your own settings.

Initialize or update the database

Do this at the beginning, and update when pulling updated code by running:

  • ./manage.py migrate

Additional setup

For additional setup information see docs/SETUP.md.

Running the development server

  • ./manage.py runserver

Running tests

You need to process static files before you can run tests.

  1. ./manage.py collectstatic
  2. ./manage.py test

Linting

  • flake8
  • pep256
  • pylint
  • eslint (npm install -g eslint)