Category Archives: Programming

How virtual environments work in Python

By | February 6, 2025

In Python there are generally 2 options for creating virtual environments. (Virtual environments are a must by the way so I won’t go into the pros and cons. Trust me and just use it). venv Firstly, there is venv which is shipped with Python so you can think of it as a standard library. virtualenv… Read More »

How to install Python on MacOS

By | February 5, 2025

Installing pyenv (brew install pyenv) The first step is to install pyenv which is Python’s version management system. You can read more about where it came from and what it does here but in a nutshell, it is a project that was forked from rbenv and ruby-build, and modified for Python and it let’s you change your… Read More »

How to get Django working on PythonAnywhere

By | October 3, 2024

First you want to follow part 1 of this tutorial to get Django installed: https://help.pythonanywhere.com/pages/FollowingTheDjangoTutorial/ Half way through you’ll want to jump to: https://docs.djangoproject.com/en/4.1/intro/tutorial01/ which essentially tells you to run: Once this is done, you can either go to:

Displaying data with dynamic accordion

By | November 12, 2023

If you want to have an accordion feature to show extra data where you are displaying data from a database on an existing row, you need create set some extra attributes on the first row. One important attribute is data-target which needs to contain a dynamic value such as This then points to the second… Read More »

Thumbnail bug in python simple gallery

By | November 8, 2023

Python simple gallery is pretty neat but there is an issue when generating thumbnails if your photos are named a certain way. The filename is split at the first dot and then .jpg is added to the file name. My photos are named: 2023-09-24 19.00.43.jpg which means everything after the hour is truncated. ie the… Read More »