Software development
DBCA software developers are encouraged to undertake development locally in an environment that is as close as possible to the final deployed application environment in order to reduce the incidence of “works on my machine” problems.
The department’s standard operating environment (SOE) is currently Microsoft Windows 11, so the majority of DBCA developers are assumed to be carrying out development within this operating system and the following advice is written with this in mind. The one “essential” development tool is Git, which is our designated version control software solution. Refer to the Git page for more information about installing and using Git.
Development tools are generally expected to be installed via Company Portal (a request to Service Desk may be required to enable installation of specialised development software). New software can be made available for installation, subject to review and approval.
Development IDE
The software development IDE is a matter of preference for the individual developer. Microsoft’s development IDE Visual Studio Code is a good choice and is available for install on Company Portal. It is free to use, well documented, well-supported and highly configurable. It also plays extremely well with WSL (see below) via an extension.
Web development stack
To summarise the OIM-recommended technology “stack” for new web development projects:
- Python - programming/scripting language
- Django - Web application framework
- PostgreSQL - relational database
- Git - project code source control
- Docker - software containerisation
This selection of technologies is not prescriptive, but represents a proven, reliable and well-supported set of options that are used extensively for existing systems.
Python
Python is a general purpose programming language which is dynamically typed, interpreted, and known for its easy readability. General principles to be aware of when undertaking development of applications using Python:
- Python 3 - New projects should always be developed against a recent version of Python 3. Notwithstanding the similarities, Python 2 is no longer maintained for the purposes of features or security.
- Correct tool for the job - developers should be mindful of using Python where its strengths are greatest (rapid prototyping, versatility, portability, maintainability) versus other tools that may have advantages (SQL for database queries, command-line tools for file/text handling, JavaScript for DOM manipulation, etc.)
For installation, a supported version of Python 3 is available via Company Portal. Alternatively, Ubuntu via WSL (see below) will include Python. For usage instructions, see this page.
A suggested syllabus for learning Python for the purposes of web application development is as follows:
- Install Python 3 on your PC via Company Portal.
- If required, take a crash course in the Python syntax.
- For a more thorough overview of Python syntax, read the Dive Into Python ebook, chapters 0, 1, 2, 3, 4, 7, 11 & 14 (the whole book is valuable, but these chapters will get you basically productive).
Python environment management
Once you start working on more than one project, managing separate and isolated Python environments for each one becomes a requirement. This is a good primer on Python virtual environments and why you need them.
There are many different Python environment management tools on the market (pip, pip-tools, Poetry, Pipenv, etc.) and the choice always remains with the individual developer, but the current recommended tool is uv. It’s fast, easy to use, and is Python-standards-compliant. First steps are as follows:
- Install uv on your development PC.
- Install a specific version of Python using uv.
- Create an isolated Python environment and begin experimenting with it.
Django
Django is our recommended framework of choice for non-trivial web applications requiring a significant amount of business logic, direct manipulation of databases, and a large amount of user interaction. It is a “full stack” web framework that includes all of the components required to develop a complex web application for internal or external customers. It also boasts some of the best online documentation to be found.
A learning syllabus for Django is as follows:
- Once you have a good understanding of Python syntax, complete the ENTIRE Django tutorial (really, the whole thing): https://docs.djangoproject.com/en/dev/
- As an alternative/supplement to the Django docs tutorial, Mozilla has an excellent tutorial series for Django: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django
Examples of DBCA-built web applications using Django:
- Planning Referral System - code repository at https://github.com/dbca-wa/prs
- IBMS - code repository at https://github.com/dbca-wa/ibms
To minimise development effort, we typically take the following approach when building a new system:
- Define a good data model with constraints: Django models.
- Add validation for model fields.
- Use the built-in Django admin for testing and validation of the data model.
Git
The usage of Git for version control is covered in detail on this page: Git
The department makes use of the dbca-wa GitHub organisation for code management. DBCA developers should create a GitHub account and request OIM for an invitation to the organisation. GitHub Desktop is available for install via Company Portal.
Docker
The department’s preferred method of serving bespoke web services is as containerised Docker images and deployed using Kubernetes. Therefore, it is useful for developers to install and run Docker locally. A sensible approach is to install and run Docker inside a WSL development environment (see below). A guide for installing Docker inside the Ubuntu WSL is available here (includes instructions for installing the Azure CLI and dotnet core). If Ubuntu is not used, Docker Desktop for Windows may be installed via Company Portal (a license is required).
We maintain a document that may serve as an introduction for developers to start learning about Docker here: Docker.
Note that production containerised systems are served in a managed Azure Kubernetes (AKS) cluster. Additional external resources for learning about Kubernetes are listed below:
- Kubernetes Crash Course - an extremely approachable and clear introduction to Kubernetes concepts.
- Introduction to Kubernetes on Azure - learning path from Microsoft. Pretty thorough introduction to Docker, containers and AKS in general.
- Awesome Docker - a curated list of resources related to Docker.
Developing in Linux - Windows Subsystem for Linux (WSL)
Many of the department’s bespoke systems are built and deployed against a Linux environment, therefore it is highly recommended for developers to carry out development locally within a similar environment.
Microsoft has made it surprisingly easy to run a Linux environment under Windows 10 and later. Windows Subsystem for Linux is a modern alternative to a virtual machine, as it runs natively on local hardware, meaning performance is rarely an issue. Installed WSL environments also run directly on the local filesystem, so all local files can be read and copied as required. You can happily run Visual Studio Code in Windows with a project in a WSL environment for development via the optional WSL extension.
For a good experience, OIM recommends that developers use WSL to install and run a recent (LTS) version of Ubuntu Server. This OS is free, has excellent technical support, up-to-date packages, and (importantly) has a vast corpus of documentation available. Ubuntu via WSL is available for installation via Company Portal.
Some good resources for developers new to working in a Linux command-line environment are as follows:
Software development best practices
The following ebook is a well-regarded and highly readable collection of advice related to software development: Andrew Hunt, David Thomas - The Pragmatic Programmer - your journey to mastery
Good software development practice is not just about writing code that works; it is also about writing code that is maintainable, testable, resilient and secure. The Australian Signals Directorate’s Guidelines for software development are a useful reference point for this, particularly in government and critical infrastructure contexts. They emphasise that security should be built in from the start, rather than treated as a final quality check after the fact.
A practical set of principles for developers includes:
- Security by design - identify risks early, assess the impact of failures, and design access controls, data handling and error-handling patterns before implementation begins.
- Secure coding practices - validate all inputs, manage errors safely, avoid unsafe file and process operations, encode output correctly, and prefer well-understood libraries and frameworks over bespoke solutions.
- Least privilege and segregation of duties - systems should grant only the permissions required for a task, with administrative functions separated from business functions where possible.
- Dependency and patch management - review third-party libraries and frameworks regularly, keep them current, and apply patches promptly for known vulnerabilities.
- Secure configuration and secrets management - avoid hard-coded credentials, store secrets in approved secret-management solutions or environment variables, and ensure production defaults are hardened.
- Testability and automation - automate unit, integration and security tests as part of the development lifecycle so regressions are caught early and code quality is consistently measured.
- Code review and change control - peer reviews should check not only correctness, but also security implications, maintainability and operational impact.
- Observability and resilience - implement appropriate logging, alerting, monitoring and failure handling so issues can be detected and remediated quickly.
- Documentation and maintainability - good documentation, clear naming, modular design and manageable interfaces reduce the chance of accidental breakage and make secure future changes easier.
In other words, the goal is to build software that is easy to reason about, easy to change, and safe to operate in a real-world environment. These are core principles both of the Pragmatic Programmer philosophy and of the ASD’s guidance for secure software development.
Information security
Information security is an important topic and relevant to all software developers. The department runs an Information Security Awareness Program (ISAP) training course that is compulsory for all staff. Even if the information seems basic, try to internalise the content and cultivate a security mindset.
Other useful information security resources/advice:
- 1Password - a service for managing and sharing organisational secrets within OIM.
- Keep sensitive information out of project repositories - don’t commit user credentials, passwords, access keys or database dumps to the repository. Get in the habit of creating a
.gitignorefile and adding relevant file patterns to it in order to reduce the chance of this happening. - In the case of credentials or keys, the recommended approach is to make your settings/config code read these pieces of information in via environment variables.