Manage planning considerations through standards process
python 3.10
node 18 (for frontend assets build)
postgresql
docker compose run --rm assets-build
docker compose up
docker compose down -v
docker compose up
createdb dluhc-planning-considerations
make init
flask db migrate -m "description of the migration"
flask db upgrade
flask run
The below is needed for local development and must not be committed to github. Therefore
add to a file called .env which is gitignored.
AUTHENTICATION_ON=true
GITHUB_CLIENT_ID=[client id]
GITHUB_CLIENT_SECRET=[secret]
The application is deployed to Heroku and is called planning-data-design. Go to app
DATABASE_URL: [set from deployment env]]
FLASK_APP: application.wsgi:app
FLASK_CONFIG: application.config.Config
GITHUB_CLIENT_ID: [available from github app settings]
GITHUB_CLIENT_SECRET: [available from github app settings]
SECRET_KEY: [set from deployment env]
SAFE_URLS: [domains that auth process can redirect users to after login]
AUTHENTICATION_ON: [turn login required on/off]
DNS for this application is managed between Digital Land route 53 and Heroku. Configuration is managed on the Heroku side on the /apps/planning-data-design/settings page of the dashboard.
The application is monitored via Sentry - accessible through the Heroku dashboard page for this application on the resources tab.
The application uses GitHub OAuth for authentication. Only members of the digital-land GitHub organization can log in to the application. The authentication flow:
- Users are redirected to GitHub to authorize the application
- After authorization, the application checks if the user is a member of the
digital-landorganization - If they are a member, they are logged in
- If they are not a member:
- Their OAuth token is revoked
- They are redirected back to the index page with an error message
For local development authentication, set the following in DevelopmentConfig:
AUTHENTICATION_ON = True
# Add these to .env file (do not commit to GitHub)
GITHUB_CLIENT_ID=[client id]
GITHUB_CLIENT_SECRET=[secret]The following tasks should be run regularly to maintain the application data:
-
flask consider load-data- Updates the local database with the latest production data
-
flask consider load-questions- Updates question sets in the database
- Questions are defined in
application/question_sets.py
-
flask consider check-questions- Validates question configurations before loading
- Checks for valid slug references between questions
-
flask consider check-dataset-links- Validates and updates dataset URLs and metadata
-
flask consider generate-performance- Generates performance metrics for considerations
The repository uses GitHub Actions for continuous integration and automated backups:
- Runs on every push and pull request to the main branch
- Installs Python dependencies
- Runs flake8 for linting
- Runs pytest for testing
- Runs daily at midnight UTC
- Downloads the latest planning considerations CSV from the design site
- Saves to
data/planning-considerations.csv - Automatically commits and pushes changes if the file has been updated
- Runs daily at 1am UTC
- Downloads the latest database backup from Heroku using
pg:backups:download - Saves to
data/latest_backup.dump - Automatically commits and pushes changes if the backup has been updated
- Requires Heroku authentication via
HEROKU_OAUTH_TOKENsecret
Tag definitions are stored in a CSV file stored in the data folder.
To update these finishing or add new ones, please update the CSV.
Some links shown in the useful links section require authentication and therefore should not be shown to the public.
We decide which links show and not show based on their domain. This list is stored at the top of the consideration.html file.
Please note: you should include the host, for example, https://www.example.com/ would be www.example.com.
To add a new event to the list, edit the data/upcoming-events.yml file. Each event should be added as an item under the events: key, following the existing format.
- id: 2025-10-15-data-standards-community
name: 'October - Data Standards Community: Planning Permissions'
owner: Planning data team
start_time: '2025-10-15 10:30:00'
end_time: '2025-10-15 12:00:00'
joining_link: https://example.com/join
link: https://example.com/info
location: Online / Remote
type: general
audience: Designers, creatives, and enthusiasts
description: |
Brief description of the event, agenda, and any relevant details.- id: Use a unique identifier, ideally in the format
YYYY-MM-DD-event-name. - name: The event title.
- owner: The team or person responsible.
- start_time and end_time: Use
YYYY-MM-DD HH:MM:SSformat. - joining_link: Link for joining the event (e.g., registration or meeting link).
- link: Additional info or registration link.
- location: Specify if online, remote, or a physical location.
- type: Event type (e.g., general, workshop).
- audience: Who the event is for.
- description: Use the pipe
|for multi-line descriptions.
Add your event to the end of the list, following the YAML syntax. Validate your changes to avoid formatting errors - you can use a tool like Yaml Lint to do this.