Post Image

Python – Benefits of using a Virtual Environment

Posted at 3:05 AM on 09-20-2018

A virtual environment can be extremely useful when developing multiple projects that require different dependencies, developing across multiple computers, and making it easier to collaborate with others on projects. In this post I will be outlining what exactly a virtual environment is and how to...

Jinja2 - Calling Python Functions

Posted at 8:47 PM on 09-18-2018

You should take every effort to not use any programming logic within your Jinja templates but there are times where you have no choice and the best of the bad options you have available to you is to give Jinja access to a python function to grab data out of the database or do some other tasks. In...

Post Image

Jinja2 - Custom Filters

Posted at 1:19 AM on 09-18-2018

When using Jinja2 as your template engine you will no doubt eventually use a filter to control the output of what jinja is rendering for you. An example, lets say that you are storing raw HTML in your applications database and you want to render that html directly into your page. You can use the "s...

Post Image

Python – List Comprehensions

Posted at 6:44 PM on 09-17-2018

In Python you can use list comprehensions to shorten the amount of code that you need to use to accomplish tasks when working with lists. The first time I heard of list comprehensions it sounded very advanced and confusing and when I looked at some example code I was, as I expected confused. Fear...