Implementing user authentication is fairly easy job in Django, many functionalities are already included in the standard Django installation, you can manage users using the default “admin” app the comes with Django.

Here I will show how implement Login/Logout feature by relying on Django built-in views.

Steps:

Create “accounts” app: we will put all “accounts” related files in this app.

Create URL mapping for login and logout pages.

Include “accounts” URL in the main URL mapping.

Create login page HTML template

Add small template code to show current user in all pages (changing base template)

The following is a sample Makefile for simple project, here I am building a simple “Bloom Filter” library, and “main” program to use it. The library will have the following files:
* hash.h and hash.c
* bloom.h and bloom.c and we should get “libbloom.a” out of it. The “main” program will use:

main.c

bloom.h

libbloom.a and we should get “main” executable. So our make file should look like this: