Skip to content

Content Management System service for directory apps

License

Notifications You must be signed in to change notification settings

thibaudcolas/directory-cms

 
 

Repository files navigation

directory-cms

circle-ci-image codecov-image snyk-image

Directory CMS - the Department for International Trade (DIT)


For more information on installation please check the Developers Onboarding Checklist

Development

We aim to follow GDS service standards and GDS design principles.

Requirements

Python 3.6

Running locally

Installing

$ 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

Running the webserver

$ source .venv/bin/activate
$ make debug_webserver

New /etc/hosts file entry

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.

Running the tests

$ make debug_test

Create a new template_sql file

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

Session

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.

Image storage

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.

About

Content Management System service for directory apps

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 71.3%
  • PLpgSQL 27.9%
  • Other 0.8%