Graphical Guestbook

1 minute read

See the source code on GitHub

Screenshot of the guestbook in action showing several test drawings.

A guestbook inspired by the guestbooks commonly found on websites of the 90s and early 2000s, but it allows visitors of a website to leave a drawing instead of a text message.

Overview

This project was created over a weekend as a hobby project. It is a lightweight MVC style web application based on Web.py that uses a Sqlite database. The data models for the application do not use an ORM and instead use custom classes for database abstraction. It was initially written in Python 2.7 and then ported to Python 3x.

The web front end utilizes an HTML5 canvas and a bit of Javascript to allow users to draw a picture. When the user presses the submit button, the image is sent to the server as a base64-encoded image blob. The image is processed using PIL, saved to the filesystem and an entry for the image is added to the database.

Requirements

  • Python 3.6+ (Older 3x versions may work)
  • The following Python libraries:

Application settings are contained in “settings.py”. You should read the comments in that file if you decide to play with this project.

Usage

Visitors to the website are presented with a canvas that they can draw on using a round brush of any size and color they desire.

The web front and was created using JQuery, which wasn’t strictly necessary but made development faster and resolved some HTML canvas compatibility issues that existed at the time of development. The color picker uses jscolor.

Screenshot of the drawing canvas

The layout an look of the guestbook can be modified by altering index.html in the templates directory and the css files in the static files directory.

Updated: