Git Product home page Git Product logo

nhsuk-content-store's Introduction

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

Dependencies

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

Development installation

Without Docker

  1. Clone the repository:

    git clone https://github.com/nhsuk/nhsuk-content-store
    cd nhsuk-content-store
    
  2. Install virtualenv if you don’t have it already:

    pip install virtualenv
    
  3. Create and activate the virtualenv:

    virtualenv --python=python3 env
    source env/bin/activate
    pip install -U pip
    
  4. Install the dependencies:

    pip install -r requirements/dev.txt
    
  5. Create a local.py settings file (it’s gitignored by default) in case you need to override things:

    cp nhsuk/settings/local.py.example nhsuk/settings/local.py
    
  6. 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 local.py file:

    psql -p5432
    create database nhsuk;
    
  7. Configure the db:

    ./manage.py migrate
    ./manage.py createsuperuser
    
  8. Start the server:

    ./manage.py runserver
    
  9. Visit http://127.0.0.1:8000/admin/ and log in using the username/password chosen when running createsuperuser

With Docker

  1. Clone the repository:

    git clone https://github.com/nhsuk/nhsuk-content-store
    cd nhsuk-content-store
    
  2. Build the image:

    docker-compose build
    
  3. Start the container:

    docker-compose up
    
  4. Configure the db. In another terminal session:

    docker-compose exec content-store ./manage.py migrate
    docker-compose exec content-store ./manage.py createsuperuser
    
  5. Visit http://localhost:8000/admin and log in using the username/password chosen when running createsuperuser

Contributing

  1. Make sure you configure your editor to use the flake8 config file setup.cfg

  2. To run the unit tests:

    ./manage.py test
    
  3. Make sure you isort your imports before committing:

    isort -rc .
    
  4. Make sure you run lint before committing:

    flake8 .
    

Heroku

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.py: heroku settings file
  • nhsuk/heroku_wsgi.py: heroku wsgi file
  • bin/post_compile: heroku post deploy file that runs the django migrate command automatically after each deploy

nhsuk-content-store's People

Contributors

kerin avatar marcofucci avatar tonyyates avatar tyom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.