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

Python + Django How to Test Views

Today I wanted to go over how to use Django's web client testing features. It's a fairly simple thing to grasp how to use Python's unit testing to test functions and procedures but I am finding that a lot of Django beginners are not sure how they ...

Read More

Python - Coding for MongoDB

MongoDB

MongoDB is an open source database that uses a document-based model. A RDBMS system like MySQL, Postgresql or Oracle uses an organized system of tables that have a defined set of columns and functions that relate to each. Instead of tables and rows, MongoDB uses the concept of collections ...

Read More

Python - How to Work with MySQL

What we need:

  • Python 3.6.3
  • mysqlclient module
  • MySQL server
  • mysql-workbench

First, make sure you install MySQL server and ensure it's running. Instructions on how to install MySQL server:

Ubuntu

RHEL/CentOS/Fedora

Windows

To install the mysqlclient module, you'll first need to install MySQL server (and ...

Read More

Python - How to Work with SQLite3

(see http://sebastianraschka.com/Articles/2014_sqlite_in_python_tutorial.html)

What we need:

  • Python 3.6.3
  • sqlite3 module (should be included in Python 3.6.3)
  • sqlitebrowser

On Ubuntu to get SQLite Browser you can install it from the command line:

# sudo apt install sqlitebrowser

If you're on Mac OS X ...

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