Public | Automated Build

Last pushed: a year ago
Short Description
Copy of
Full Description

|Build Status| |Dependency Status| |Coverage Status| |Documentation Status|

NHS.UK Content Store

Content Store for NHS.UK.

The full documentation is on Read the Docs <>_


  • python 3 (tested on 3.5.2)
  • postgres (tested on 9.4+)
  • docker_ if used

Development installation

Without Docker

#. Clone the repository::

    git clone
    cd nhsuk-content-store

#. Install ``virtualenv`` if you don’t have it already::

    pip install virtualenv

#. Create and activate the virtualenv::

    virtualenv --python=python3 env
    source env/bin/activate
    pip install -U pip

#. Install the dependencies::

    pip install -r requirements/dev.txt

#. Create a ```` settings file (it’s gitignored by default) in
   case you need to override things::

    cp nhsuk/settings/ nhsuk/settings/

#. Create the db. By default, the dev version uses postgres, if you want, you can switch to sqlite by uncommenting the related lines in your ```` file::

    psql -p5432
    create database nhsuk;

#. Configure the db::

    ./ migrate
    ./ createsuperuser

#. Start the server::

    ./ runserver

#. Visit ``_ and log in using the
   username/password chosen when running ``createsuperuser``

With Docker

#. Clone the repository::

git clone
cd nhsuk-content-store

#. Build the image::

docker-compose build

#. Start the container::

docker-compose up

#. Configure the db. In another terminal session::

docker-compose exec content-store ./ migrate
docker-compose exec content-store ./ createsuperuser

#. Visit http://localhost:8000/admin_ and log in using the
username/password chosen when running createsuperuser


#. Make sure you configure your editor to use the flake8 config file

#. To run the unit tests::

./ test

#. Make sure you isort your imports before committing::

isort -rc .

#. Make sure you run lint before committing::

flake8 .


The app is ready to be deployed to Heroku for testing purposes, Heroku
shouldn’t be used prod with this setup.

By default, the assets are stored/retrieved from Heroku whilst the
uploaded images are stored/retrieved from Azure Storage.

Heroku specific files:

  • requirements.txt: which includes requirements/heroku.txt
  • nhsuk/settings/ heroku settings file
  • nhsuk/ heroku wsgi file
  • bin/post_compile: heroku post deploy file that runs the django migrate command automatically after each deploy

.. _docker:
.. _http://
.. _http://localhost:8000/admin:

.. |Build Status| image::
.. |Dependency Status| image::
.. |Coverage Status| image::
.. |Documentation Status| image::

Docker Pull Command
Source Repository