Hi, I'm Harlin and welcome to my blog. I write about Python, Alfresco and other cheesy comestibles.

Python + Django - How to use the built-in authentication system

In this article I want to show you how to use the built-in authentication system that Django provides for you out of the box. You could build your own authentication functionality into a view by doing the following:

  1. Check to see if the request.user is authenticated.
  2. If the user ...

Read More

Python - How to Set Up a Simple HelloWorld Django App

The purpose of this post is to provide a set of instructions to create a simple helloworld app in Django. This app can then be used for testing purposes in other posts I've written.

Set up virtual environment:

# pyenv global 3.6.3
# pyenv virtualenv deploy_django
# pyenv local deploy_django ...

Read More

Python - How to Group Imports

In case you were ever wondering, here is the standard way to group your imports.

# Standard library imports
import os
import sys

# 3rd party modules
from django.http import HttpResponseRedirect
from django.shortcuts import render

# My project-wide modules
from blog.settings import THEME
from lib.util import get_http_referer

# From separate ...

Read More

Python - Understanding Querying in Django

If you're an old guy like me, you are probably used to SQL queries. You can certainly use them with Python to retrieve data from RDBMS servers but they can be a little problematic for a number of different reasons. They can be difficult to implement without writing a ...

Read More

Python - Simplest Django Tutorial Ever

I wanted to write up a very simple Django tutorial that will show you the workflow behind creating a very simple CRUD app. The workflow is repeatable of course. You can use it to build more functional apps.

The steps below will show you how to build a simple ToDo ...

Read More