Skip to content

madicorp/3caassurance

Repository files navigation

3caassurance

Requirements

Python 2.7

Install work environment

If virtualenv is not installed
pip install virtualenv

Create virtualenv
virtualenv venv

Install dependencies
pip install -r requirements.txt

Activate venv

source venv/bin/activate

Launch locally

Do Activate venv
Ensure local_launch.sh has the execution rights
./local_launch.sh

Deployed on http://127.0.0.1:8000/
Admin page accessible at http://127.0.0.1:8000/admin/

I18N

Add I18N key and translations to locale/fr/LC_MESSAGES/django.po
Once done, python manage.py compilemessages -l fr
This is automatically done when using the Vagrant configuration

Updating the migration files

./manage.py dumpdata auth.user --natural-foreign --indent 2 > _3caassurance/fixtures/user.json
./manage.py dumpdata wagtailimages.image --natural-foreign --indent 2 > _3caassurance/fixtures/images.json
./manage.py dumpdata -e wagtailcore.groupcollectionpermission -e auth.permission -e contenttypes.contenttype -e wagtailimages.image -e sessions.session -e auth.group -e auth.user -e wagtailcore.grouppagepermission --natural-foreign --indent 2 > _3caassurance/fixtures/_3caassurance.json

CLI setup

source aliases.sh

Build 3ca dev docker image

Do CLI setup
build_image dev

Launch project

POSTGRES_USER="admin" POSTGRES_PASSWORD="changeme" CONTACT_EMAIL_PASSWORD=$contact_mail_3ca_app_pwd redeploy dev

POSTGRES_USER, POSTGRES_PASSWORD, CONTACT_EMAIL_PASSWORD env vars and the ENV param are mandatory
CONTACT_EMAIL_PASSWORD is the app password set on the contact email account

Dev archi
Figure 1. Dev architecture

Launch tests

./manage.py test