How to create a 3 Stage Deployment Pipeline With Github Actions

In this post I will show you how to setup a nice 3 stage deployment pipeline that will lint and test your code before deploying to a specific stage, using Github Actions

I will be simulating a Python application for this post, so you should modify the Python related stuff according to your project.

🔧 Build And Test Workflow

This workflow will lint, type check, and test the project before deploying to any stage. Create a .github/workflows/build-and-test.yml file:

github actions

Django: Adding Context Data to Class Based Views Using Properties

When using Class-Based Views in Django, we normally add additional context data to the view by implementing the get_context_data() method:

class MyDetailView(DetailView):

    def get_context_data(self, *args, **kwargs):
        context = super().get_context_data(*args, **kwargs)
        context['foo'] = 'bar'

        return context

This works well. But I am very fond of using another approach, so as to not pollute the get_context_data method. We can achieve this using properties:

Older Posts →