This script will create a new Django project using various defaults for US government websites.
- Run
pipenv install
- Run
pipenv run python 18f_django_template.py
If any of these options are not provided on the command line, then you will be prompted for them interactively.
-
--app-name=<new-application-name>
: This is used as the name of the new application's directory and a Python identifier is derived from it and used as the name of the new Django app inside that directory. -
--uswds/--no-uswds
: For application's that don't have an HTML frontend, you can specify--no-uswds
to not install the US Web Design System (USWDS). If you do choose to install USWDS, then you will need to have Node.js/npm installed locally for the installation. -
--circleci/--no-circleci
: Configure continuous integration with the CircleCI service (or not). The resulting project will have a.circleci/config.yml
file. -
--github-actions/--no-github-actions
: Configure continuous integration with Github Actions. The resulting project will have.github/actions
and.github/workflows
directories.
- Create a better default
README
- Copy
CONTRIBUTING.md
andLICENSE.md
from the 18F Open Source Policy repo - Create a "near-production"
ci
django environment, used for running a11y and security scans - Create a "near-production"
staging
django environment, used for cloud.gov staging environment, with a "TEST SITE" warning banner - Create a
.nvmrc
file for specifying the NodeJS version in use - Set up
pa11y-ci
for a11y scanning - Set up
OWASP ZAP
dynamic security scanning - Include
django-csp
package and configure CSP header to get OWASP passing by default - Install and configure bandit for static security scanning
- Install
bundler-audit
and set upbundle:audit
rake task for Ruby dependency security scans - Install flake8 for python linting
- Install black for python formatting
- Install django-webtest for unit testing
- Install coverage.py for coverage reporting
- Create a separate production credentials file.
- Create a
pre-commit
hook that can be used to automatically run black, flake8 and bandit - Setup USWDS via postcss
- Update
templates/base.html
include the USWDS Banner - Create boundary and logical data model compliance diagrams
- Create
manifest.yml
and variable files for cloud.gov deployment - Optionally create Github Actions workflows for testing and cloud.gov deploy
- Optionally create terraform modules supporting staging & production cloud.gov spaces
- Optionally create CircleCI workflows for testing and cloud.gov deploy
- Optionally create a New Relic config with FEDRAMP-specific host
- Optionally configure DAP (Digital Analytics Program)
- Create Architecture Decision Records for above setup
- Commit the resulting project with git (unless
--skip-git
is passed)
To run the test suite, run pipenv install --dev
and then pipenv run pytest
from this repository directory. Make sure you have npm
and docker
installed as some tests require them.
Bug reports and pull requests are welcome on GitHub at https://github.com/18f/django-template. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
Everyone interacting in the 18F Django Template project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.