This repository contains the code for the Open Humans Website.
pip3 install virtualenv
)apt-get install libffi-dev
in Debian/Ubuntu or brew install libffi
in OSX)apt-get install libpq
in Debian/Ubuntu or brew install libpq
in OSX)apt-get install libpq-dev python3-dev
and
apt-get install postgresql postgresql-contrib
in Debian/Ubuntu)apt-get install memcached libmemcached-dev
or brew install memcached
)For the following commands, you'll also want to set up virtualenvwrapper:
pip3 install virtualenvwrapper
.bashrc
as needed): http://virtualenvwrapper.readthedocs.io/en/latest/install.htmlCreate a virtualenv for Python 3.6, e.g.:
mkvirtualenv open-humans --python=/usr/bin/python3.6
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
gulp
)npm install -g gulp
npm install
Update after pulling updated code by repeating:
npm install
Running this site requires a PostgreSQL database (even for local development).
sudo su - postgres
createdb mydb
createuser -P jdoe
psql
GRANT ALL PRIVILEGES ON DATABASE mydb TO jdoe;
ALTER USER jdoe CREATEDB;
\q
exit
Use env.example
as a starting point. Copy this to .env
and modify with your
own settings.
Do this at the beginning, and update when pulling updated code by running:
./manage.py migrate
For additional setup information see docs/SETUP.md.
./manage.py runserver
You need to process static files before you can run tests.
./manage.py collectstatic
./manage.py test
Please use black
to format code prior to commits. Set up a
pre-commit hook by running the following:
pre-commit install