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): Then it may be because the setUp function of the test class has not set up correctly. Spent some time going round in circles until I … Continue reading AttributeError: ‘FlaskClientTestCase’ object has no attribute ‘app_context’ – Unit Testing (Python)

AWS Lambda – Stop Instances Outside Office Hours (Python / AWS)

I previously wrote about using some Python to stop AWS EC2 instances that had the tag “office_hours” and indicated that this could be automatically run via AWS Lambda. This blog post is a brief follow up with some notes on creating the Lambda function, using the Python from the previous blog post. Using AWS Lambda … Continue reading AWS Lambda – Stop Instances Outside Office Hours (Python / AWS)