Directory CMS - the Department for International Trade (DIT)
For more information on installation please check the Developers Onboarding Checklist
We aim to follow GDS service standards and GDS design principles.
$ git clone https://github.com/uktrade/directory-cms
$ cd directory-cms
$ virtualenv .venv -p python3.6
$ source .venv/bin/activate
$ pip install -r requirements_test.txt
$ make debug_db
$ make debug_migrate
$ make debug_createsuperuser
$ source .venv/bin/activate
$ make debug_webserver
UI clients on local expect the CMS to be reachable at the address http://cms.trade.great.
Add 127.0.0.1 cms.trade.great
You can test this works by attempting to visit http://cms.trade.great:8010/admin in your browser.
$ make debug_test
To speed up tests a SQL template file is provided. If the file becomes obsolete run the following command on an up-to-date db instance
$ pg_dump -O -f db_template.sql directory_cms_debug
Signed cookies are used as the session backend to avoid using a database. We therefore must avoid storing non-trivial data in the session, because the browser will be exposed to the data.
Pages and images can be copied "upstream" from one environment to another. To facilitate this a single S3 bucket is used by all environments. A constraint of this approach is the bucket is immutable insofar as images can be uploaded but not deleted or changed.
The following environment variables must be set on your host machine:
env var |
---|
DIRECTORY_CMS_AWS_STORAGE_BUCKET_NAME |
DIRECTORY_CMS_AWS_ACCESS_KEY_ID |
DIRECTORY_CMS_AWS_SECRET_ACCESS_KEY |
Speak to a team mate or consult heroku settings to retrieve the DIRECTORY_CMS_AWS_STORAGE_BUCKET_NAME
.