Posts about Python

September 26, 2017

5 Tips for Writing Better Python

I’ve been writing Python for some time now, and when I reflect on some of the older code I’ve written… I sometimes cringe. For example, when I was just starting out, I wrote this Sudoku game in python (available on GitHub here). I thought that this was one of my better pieces of work at the time. It turns out I can’t even clone and run this because I didn’t add a setup.py or requirements.txt file, a mistake I would never make today!

Read More
Why You Shouldn’t Import Functions and Classes Directly in Python

Why You Shouldn’t Import Functions and Classes Directly in Python

Today I was doing some programming, trying to finish up an old project that was 80% done, but I never finished. The project is an API for sharing beer ingredient data, being the avid homebrewer that I am. I was in the middle of writing some pretty simple authentication logic, when I found a weird bug in my code. The code, featured below, was pretty straightforward, or so I thought.

Read More
building construction site with crane
August 15, 2017

Building a Web App with React and Django: Getting Started — Part 1

So you want to build a web app. Well, what’s stopping you? If you’re reading this, you’ve probably already been programming for some time, but you’re just missing some of the steps. I’ve been there before. I know how frustrating it can be to know 70% of what you need to do to build a killer web app for an idea you have, but not have enough knowledge to take the idea from beginning to end.

Read More
Django Server Setup
April 7, 2015

Django Server Setup

This tutorial will show you how to serve a Django application by using PostgreSQL, Gunicorn, and NGinx on an Ubuntu server. I created this tutorial because when I started configuring my server, I had a lot of trouble finding anything useful when it came to serving Django apps built in Python 3. I found that virtually all the tutorials I could find still insisted on using Python 2. So, this will show you how to turn your Python 3 Django app into a fully fledged website. This tutorial uses the following software with the corresponding versions:

Read More