- Checkout the source code.
mkdir -p ~/code && cd $_
git clone [email protected]:tystakartografen/cogs3.git
- Create a virtual environment.
mkdir -p ~/venvs/cogs3 && cd $_
virtualenv -p /usr/local/bin/python3 .
source bin/activate
Replace /usr/local/bin/python3
with the path to a Python 3 executable.
On macOS this should be installed from Homebrew.
- Install the requirements.
cd ~/code/cogs3
pip install -r requirements.txt
- Configure the environment variables.
cd cogs3
mv .template_env .env
-
Edit
.env
to include, at a minimum, an arbitrarySECRET_KEY
. Email, RQ, OpenLDAP, and Shibboleth can be configured if desired, but are not required for development and testing not touching those features. -
Create the database.
cd ..
python manage.py migrate
- Load institution data into the database, default institution data is available in fixtures.
python manage.py loaddata institutions.yaml
- Create an admin user.
python manage.py createsuperuser
- Run the unit tests.
python manage.py test -v 3
- Generate coverage report.
coverage run manage.py test
coverage html
- Install redis.
brew install redis
Replace brew
with your package manager. On Debian and Ubuntu, the package
is named redis-server
; i.e.
sudo apt install redis-server
- Start the redis server.
redis-server &
- Test redis server is running.
redis-cli ping
>>> PONG
- Start the development server.
python manage.py runserver