A simple, user-friendly online service for citizens to submit pleas for summary motoring offences.
Clone the repository:
git clone git@github.com:ministryofjustice/manchester_traffic_offences_pleas.git
You'll need:
- python 3.6
- postgres database with hstore
- rabbit-mq for celery tasks
apt/development.sh
should have all the dependencies you need. Python packages are in requirements/
. You can set up virtualenv and do pip install.
Few steps you may also need:
cp manchester_traffic_offences/settings/local.py.example make_a_plea/settings/local.py
psql -c 'CREATE DATABASE manchester_traffic_offences;' -U postgres
./manage.py migrate --noinput
./manage.py compilemessages
Start server with:
./manage.py runserver
Start celery workers (if you need to test sending emails) with:
celery worker -A make_a_plea
There's a dev container that can be used to quickly spin up a working site, useful to run tests against without having to go through a local setup.
docker build -t makeaplea:dev -f Dockerfile.dev .
docker run makeaplea:dev
To run locally, you will need Python behaving package installed with Selenium and Chrome/driver working.
Run on default host (127.0.0.1:8000)
behave
Run in headless mode against another host (like docker). Omit @local as the mailmock needs local file access.
behave -Dheadless -Dbase_url=http://172.17.0.2 -tags=-local
Front-end development uses the gulp task runner.
Make sure you have nodejs installed, then run:
npm install
Completely removes the /make_a_plea/assets
directory.
Creates /make_a_plea/assets/healthcheck.txt
used for uptime stats.
Compiles all SASS source files to CSS stylesheets and sourcemaps into the /make_a_plea/assets/stylesheets
and /make_a_plea/assets/maps
directories.
Compiles all JavaScript modules and scripts to the /make_a_plea/assets/javascripts
directories and copies over the vendor dependencies.
Runs JSLint on all non-dependencies source JavaScript files.
Runs the JavaScript modules tests. Configuration in karma.conf.js
.
Optimises all image assets into /make_a_plea/assets/images
.
Sets up a watch on a number of directories. When a file has been changed, the relevant tasks are then automatically run:
- For files in
/make_a_plea/assets-src/stylesheets
:sass
task - For files in
/make_a_plea/assets-src/javascripts
:lint
, thenjs
tasks - For files in
/make_a_plea/assets-src/images
:images
task
This is the default task, which can be run by simply using gulp
. It runs the following tasks:
clean
healthcheck
lint
js
images
sass
Translations for the Welsh language are currently achieved using gettext and .po language files.
When content requiring translation has been added, the source English language .po file should be updated. To do so, run the makemessages script, which will update the .po file to include the latest source strings:
./makemessages.sh
It may then be necessary to manually find strings marked as fuzzy, and check the source string matches the translation string in all cases.
Once the file has been updated, it needs to be submitted to the relevant translation team, who should then provide an updated Welsh language .po file. Replace the existing /conf/locale/cy/LC_MESSAGES/django.po
with this file, then compile the messages:
./manage.py compilemessages