Greening Digital - how to set up your django app with green coding metrics in CI
06-07, 12:00–12:50 (Europe/Madrid), Workshop

In this session attendees will learn the basics of how carbon emissions from digital services are currently measured, what tooling exists to automate this measurement, and how this can be integrated into continuous integration pipelines using open source tooling, including a worked example of a set up for a real-world open source Django project.

Recent changes in the law will mean that for some firms, reporting emissions from digital services will be necessary from 2025 onwards, so we’ll end with some pointers on how to tell if the law might apply to your organisation, and where to go to learn more.


Why this is relevant to django developers

In Europe, as a result of the changes in corporate reporting laws agreed in 2023, if digital services make up a material part of a firm's activity and the firm has more than 250 employees, then the firm will be required by law to report their emissions from digital services from 2025 onwards.

If your organisation has fewer than 250 employees, but you sell hosted services to a firm that the law applies to, because firms need to report emissions in their supply chain, as a supplier it is increasingly likely that you will be asked to provide similar numbers that they will need for their own reporting.

Where python and django fit in

Fortunately in the last couple of years, the open source tooling to measure the energy, and subsequent carbon emissions from web applications has come a long way, and a lot of them are written in python!

In addition, there are a number of well documented Django projects where effort has been put into creating sustainability roadmaps, continuous measurement setups, with helpful examples to learn from.

What to expect in the workshop

In this workshop attendees will learn how carbon emissions from digital services are measured, and what tooling exists to track them, with a specific focus on the open source Green Metrics Tool (GMT), from Green Coding Solutions Gmbh, which is also helpfully written mostly in python.

This is one of the tools used for understanding and measuring the carbon emissions associated with Wagtail, a well known open source django CMS in the Google Summer of Code of 2023.

We’ll also run through a worked example of an open source django project setup, and show how it is possible to reuse many of the ideas around end-to-end testing that developers may already be familiar with, to measure and report carbon emissions associated with code paths for delivering common functionality.

While this workshop is designed not to require attendees to have a working development environment, for those who bring a laptop with one, there will be chances to play with some of the more common meaurement tooling available.

Who will be delivering the workshop?

This workshop will be delivered by Chris Adams of the Green Web Foundation. The foundation has been tracking the transition of the internet from fossil fuels since the early 2010's, and is focussed on reaching a fossil free internet by 2030. It is the non-profit that contributed the code to build carbon measurement capabilities into the Firefox browser, and the foundation uses Django extensively.

Chris first started using Django in 2008, has been delivering climate themed talks at DjangoCon conferences in Europe since 2017. As part of his role at the Green Web Foundation, he designs and delivers hands-on workshops to help developers take their first steps into the growing field of digital sustainability.


Audience Level

Intermediate

Topics

Architecture, Deployment, Testing, Community, Documentation, Teamwork