17 posts across 9 categories
How to Implement List View Pagination with Django

Pagination is an important method to restrict the number of database objects in any given view. Pagination implemented well enables users to navigate your content as they need it in addition to keeping your site …

Calculating the Fibonacci Sequence in Python

In mathematics, the Fibonacci sequence is built up by summing the previous two numbers in the sequence and appending it to the sequence. The sequence starts with 0 and 1, therefore the first ten numbers of …

Finding the Largest or Smallest n Items in Python

Create a list that contains either the smallest or largest n number of items. This can be done with either a list or a dictionary.

The heapq module has some functions that will help to …

Quick Tip: VS Code Snippet for Python Developers

A common task when debugging is to be able to inspect your variables within the terminal or your development server. This can involve putting in some print statements within your code.

Of course, for a …

Integrate a Bootstrap File Upload Utility in Django

Integrating a standard file upload feature in Django is relatively straightforward. It's simply a case of rendering the individual image field in your Django template.

For a functional image selector, there's absolutely nothing wrong with …

How to Keep a History of the Last n Items in Python

If I would like to keep a history of the last n number of items that have been seen during iteration or some other kind of processing.

A limited history can be maintained using the …

Implementing Binary Search Algorithm in Python

Binary search works based upon the process of eliminating any numbers that are either above an upper bound or below a lower bound that a number cannot be.

Binary search is called binary search because …

Calculating Prime Numbers Algorithm in Python

Another common puzzle used to develop your coding skills is to use your chosen language to find all of the prime numbers between any given range. This range would usually start from 2 since the …

Configure Heroku App with Google Domains and SSL

Setting up your Heroku app to play nicely with your Google Domains is no trivial task. There are several settings that need to be just so in order for this to work properly. This guide …

Implementing Amazon Simple Email Service for a Django Site

It's a good idea to set up a proper SMTP server that can handle large volumes of transactional emails that your application might need such as registration emails, password resets, etc. Amazon's Simple Email Service (SES) …