Flask and SQLAlchemy: Connecting To MySQL (Python / Notes)

For my assets web app, written in Flask (Python) I have separated the app and the database into separate instances. This allows me to update the app and its dependencies without impacting the database and its dependencies, or vice-versa. The database could be one of many as I'm using SQLAlchemy to handle the connectivity between … Continue reading Flask and SQLAlchemy: Connecting To MySQL (Python / Notes)

Continuous Deployment, Continuous Delivery – The CD of CI/CD (GitHub / Python / DevOps)

In this blog post I take my Flask (Python) web application and deployment to Microsoft Azure, and instead of doing it manually I do it via a CI/CD. I've previously discussed Continuous Integration (CI) in blog posts around CI, GitHub actions and recently Code Coverage. The CD of CI/CD can stand for Continuous Deployment or … Continue reading Continuous Deployment, Continuous Delivery – The CD of CI/CD (GitHub / Python / DevOps)

Using GitHub Actions To Add Continuous Integration (CI) To A Project (GitHub / Python)

A GitHub Actions job failure email

In this blog post I will be discussing Continuous Integration (CI) with GitHub Actions. Readers of previous blog entries may remember that I’ve tackled Continuous Integration (CI) with GitLab previously (see: https://geektechstuff.com/2021/04/05/python-unit-test-and-some-ci-via-gitlab-python/ ) and that last autumn (2021) I got into more testing (see: https://geektechstuff.com/2021/10/06/personal-update-django-and-mvc-mtv/ ).  Thankfully both have helped as the current module of my degree apprenticeship is … Continue reading Using GitHub Actions To Add Continuous Integration (CI) To A Project (GitHub / Python)

AttributeError: ‘FlaskClientTestCase’ object has no attribute ‘app_context’ – Unit Testing (Python)

Less of blog post and more of a reminder to myself. When using Flask and Unit Testing with Python, if either of the below errors occur (or something similar): AttributeError: 'FlaskClientTestCase' object has no attribute 'client' AttributeError: 'FlaskClientTestCase' object has no attribute 'app_context' Then it may be because the setUp function of the test class … Continue reading AttributeError: ‘FlaskClientTestCase’ object has no attribute ‘app_context’ – Unit Testing (Python)

Docker – Environment Variables, Env File & A Little Django (Python)

Docker logo

Why Use Environment Variables? Whilst building my Django project I replaced several of the values within settings.py with an option for them to be read from environment variables, rather than storing them in plain text within settings.py. This change allows me to store the settings.py file within a source control repository (e.g. Git) and also … Continue reading Docker – Environment Variables, Env File & A Little Django (Python)