Giter Club home page Giter Club logo

ministryofjustice.django-gov's Introduction

DEPRECATED

This repository is now deprecated in favour of using components in a more modular fashion.

  • django-govuk-template – adds GOV.UK templates, CSS, JS and other components from GDS’s packages. It does not offer pre-built styles (which would require this package to be constantly updated), but allows projects to determine their own workflow
  • django-govuk-forms – allows Django forms to be output with the correct HTML to be styled by GOV.UK CSS
  • the packages listed below can be used in your Django project in the usual manner if needed

Base Django App for MoJ

This can be used as a base to build MoJ Django applications. It includes some useful Django packages along with the Gov.uk template. It also includes flake8 code style test.

Includes

Django

django-cors-headers

django-extended-choices

django-filter

django-moj-irat

django-rest-swagger

djangorestframework

flake8

openpyxl

PyYAML

requests

Dependencies

  • Python 3.5 (can be installed using brew install python3)

Installation

Install via pypi

pip install django-gov

Features

govuk_template Django template and static directory are included in the package. You can extend the GovUK Template directly

{% extends 'govuk_template/base.html' %}

You can also download the latest govuk_template taball and extract the contentents to a directory of you choice

./manage.py update_gov_template -d /path/to/directory/to/unpack/

This will add the templates and static directories from the latest release of govuk_template to the directory passed as -d

You can include the default settings for all the included apps above by including the default settings in your app settings.py file

from django_gov.settings import *

You can include the urls for the healthcheck endpoints

url(r'^', include('django_gov.urls'))

Testing

If you include the whole default settings, this will add flake8 code style tests to the directory you run your apps.

You can add a setup.cfg file containing your flake8 settings to the base directory of your app.

[flake8]
exclude = .git/,env/,venv/,node_modules/, manage.py
max-complexity = 10
max-line-length = 120

API Docs

django-rest-swagger is also included. The template has been modified to use the govuk_template as a base.

see https://github.com/marcgibbons/django-rest-swagger for instructions on how to set up Swagger

ministryofjustice.django-gov's People

Contributors

s-block avatar ushkarev 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.