Tag | python

  1. Full-text Search with Django and PostgreSQL

    Django has several PostgreSQL database functions to support full-text search. If you are using PostgreSQL as the database backend, then it is easy to add full-text search to your Django app.

    In this post, I would like to build an demo app with full-text search. This post covers several PostgreSQL-specific …


  2. Python Property Decorator

    Recently, I was tracing the source code of PyPy, and a special decorator named @property caught my attention. It seems to be a mechanism for Python programmers to create a getter, a setter, and a deleter for an instance variable. For example, how could we intercept the access to a …


  3. Flask and Socket.IO

    Under some scenarios, we would like to push a message from an HTTP server to clients. For example, in a group messaging application, whenever a user sends a message to the server, the server has to push such message to everyone. Since 2001, several techniques have been proposed. Eventually, WebSocket …


  4. Python New Style Class

    Recently, I am curious about this code snippet:

    class Test(object):
        def __init__():

    Why do we have to extend or inherit from object type?

    There are no differences with or without (object) in Python 3. But there are significant differences in Python 2. If a class inherits (either directly …


  5. Comparison and Sorting in Python3

    Although I have written Python for several years, I am still not very familiar with its idioms. In particular, I don't quite understand how to compare and sort the objects in Python. That's the reason why I am writing this article.

    The rest of this article consists of following sections …


  6. Waliki Installation

    Waliki is a simple wiki app for Django. We can write wiki contents with reStructuredText and the contents will be stored in a Git repository. In this post, I would like to introduce the instructions to install Waliki.

    Getting Started

    First, install the related Ubuntu packages:

    $ sudo apt-get install git …