The Science and Conservation Directorate Information System v3 (SDIS) is a divisional Annual Reporting and Science project documentation Environment. Its main module "pythia" is named after the priestess at the heart of the Greek oracle of Delphi, whose comments and approvals were used as an early project planning tool.
fab test
run testsfab shell
run shell_plusfab go
run app on localhost:5000
- Rename
.env.template
to.env
, enter your confidential settings. - Run
fab deploy
. - Set file permissions and ownership (media, logs) for code
- Create a supervisor config following
sdis/sdis.conf.template
- Run SDIS in production mode with
honcho start
, or orchestrate with supervisor
Note: This bug could throw an error like "django GEOSException: Could not parse version info string 3.6.2-CAPI...".
Patch django/contrib/gis/geos/libgeos.py as follows:
version_regex = re.compile(
r'^(?P<version>(?P<major>\d+)\.(?P<minor>\d+)\.(?P<subminor>\d+))'
r'((rc(?P<release_candidate>\d+))|dev)?-CAPI-(?P<capi_version>\d+\.\d+\.\d+)( .*)?$')
Note the changed ( .*)?
group at the end to capture the version hash.
To setup CI with circleCI and coveralls.io, authorise the repo with both providers and provide these settings:
- Environment variables:
DJANGO_SETTINGS_MODULE
:sdis.settings
DATABASE_URL
:postgis://ubuntu:@localhost:5432/circle_test
COVERALLS_REPO_TOKEN=
: your coveralls.io repo token
Notes on DATABASE_URL
:
- The protocol needs to be
postgis
to override the defaultpostgres
. - The
DATABASE_URL
value doesn't require quotes. - The user must be
ubuntu
, no password is required. - The database
circle_test
is already provided, no need tocreatedb
.
Notes on coverage reports:
fab test
analyses coverage- pushing commits to GitHub lets circleCI generate and push the coverage reports
export COVERALLS_REPO_TOKEN=YOUTTOKEN coveralls
pushes the locally generated coverage report to coveralls.io
The Sphinx docs are built on GitHub push and hosted by readthedocs.org.
Settings on the readthedocs admin page:
- Repository URL https://github.com/parksandwildlife/sdis
- Documentation type: Sphinx HTML
- Advanced > Requirements file: requirements-docs.txt
- Advanced > Google Analytics key: add for optional insight
On separate documentation requirements:
Just to build the docs, not all SDIS requirements are necessary. Some of these requirements depend on system packages, which would need to be installed first.
Simply separating out the docs requirements will allow readthedocs.org to just install the required minimum dependencies.