Site icon Joseph Mwema – Biometrics Engineer

Python Django Biometric Authentication

This is a Python Django Web Biometric Authentication that demonstrates how Software Engineers and Software Developers can add Biometric Fingerprint Authentication to their Python Web Applications developed using the Python Django Web Framework with DigitalPersona series of Fingerprint Scanners.

I Honestly did NOT plan to Develop a Python Django Biometric Authentication PACK for Web Applications developed on the Python Django Web Framework. I all along assumed that the Python Flask Web Biometric Authentication PACK sufficed for Python Django Web Applications since the backbone is still Python.

But was I so wrong?

People have never stopped pulling these surprises on me.

I could call them out but …!

Python Django Biometric Authentication

By the way, on a similar front, though on PHP, I am also developing a PHP Web Biometric Authentication Gold PACK tailored for PHP Laravel Web Framework because the same People’s Cousins on the PHP side of things still find self-justifiable reasons as to why a PHP Web Application functionality will not work on their PHP Web Application developed on the Laravel Web Framework.

I have also developed and implemented a Raspberry Pi Biometric integration in Python too.

Whatever Python Web Framework you choose to implement your Python Web Application, rest easy, your friend Joseph here is always available and at your Beck and Call to Help you integrate Biometric Authentication in your Python Web Application.

Joseph Mwema’s Email Address and YouTube Channel’s QR Code

Let’s continue.

Unlike what I previously believed in the past, it may NOT always be comfortable and easy on some quotas to tweak a Python Flask Web Application to work as a Python Django Web Application hence the reason why I Developed Python Django Biometric Authentication PACK for those who want to implement Biometric Access Control in their Python Django Web Applications.

My Objective has always been to Help People, Companies and SMEs to integrate Biometrics Authentication in their Python Web Application Projects whether on Django or Flask but usually, People will first want to See a Django Python Biometric Authentication prototype that Works before they unanimously decide, “OK! Joseph can Help us with this. Let’s get this guy to handle Python Django Biometric Authentication for us”.

To those Folks, watch this Youtube clip below of how the Django Python Biometric Web Application I developed works.

Python Django Biometric Fingerprint Enrollment Process Youtube Video Clip

Now! As I have since established over time, People will always want to stick to their favorite Web Frameworks and not steer away to closely related Frameworks even for functionalities that would seamlessly work on both Web Frameworks and hence the reason why I developed this tailored solution to answer the request of Python Django Web Framework Developers.

To the Python Django Web Framework funs, I heard you loud and clear. This is for you.

Python Django Biometric Authentication PACK is purposely Designed and Developed for those who categorically want to integrate Biometric Authentication in Python Django Web Browser based Applications that are developed to run on Windows back-end Servers.

Python Django Biometric Authentication PACK works for Windows based Client Computers and runs on a Windows based PHP Web Server.

The functionality of adding Biometric Authentication in Python Web Browser based Applications on Windows has previously been addressed by the following Web Biometric Solutions;

Users Data enrolled by Django Biomeric Jomutech App and Archived in SQL Table in MySQL Database

The Key Features of Python Django Biometric Authentication PACK

Python Django Biometric Authentication is best suited for adding Biometric Authentication to New and Existing Django Python Web Applications for use by People, Schools, Organizations, Companies and SMEs implementing Information Management Systems developed on the Python Django Web Framework.

By Integrating Biometric Authentication in your Python Django Web Browser based Application with this Python Django Biometric Authentication PACK,  you add Biometric based Access Control features into your Web Application with Ease and Quickly.

It should NOT take you more than 30 minutes considering that I have done almost everything for you and all you have to do is to integrate the app, Python Django Biometric Authentication PACK into your Python Django Site.

If you simply want to add Biometric Enrollment and Biometric Authentication in your Django Web Application project, order this solution right now and get over that hurdle. Python Django Biometric Authentication PACK helps you accomplish that feat in a less than 30 minutes activity.

I will also work online together with you, hand in hand for 1 Month to make sure your Python Django Biometric Authentication and Integration experience is smooth (…that is if you do not mind getting a helping hand with your Python code)

The Python Django Biometric site and Jomutech app setup Python Files

models . py file and users class model

The models . py file has the users class which is a model of the back-end SQL table where a User’s Particulars and Biometric Fingerprint Data is archived after it is enrolled by the Django Biometric Jomutech App.

Below is the Python code for the users class model.

from django.db import models

class users(models.Model):
	fname = models.CharField(max_length=50)
	sname = models.CharField(max_length=50)
	empno = models.CharField(max_length=50)
	fpbiotemplate1 = models.CharField(max_length=10000)
	fpbiotemplate2 = models.CharField(max_length=10000)
	fno1 = models.CharField(max_length=2)
	fno2 = models.CharField(max_length=2)
Python Django Biometric users class SQL Table model for jomutech app and its jomutech_users SQL table

Here below is jomutech_users SQL Table created after the users class model above

The SQL table is named jomutech_users from the naming convention that follows having the app name + underscore + model class for table.

In this instance, the app name is jomutech, followed by underscore _ and finally the model class which is users hence the name jomutech_users for the backend table.

Python Django Biometric Authentication Database and jomutech_users SQL Table

views . py file

Below is part of the code in the views . py file for user biometric authentication.

After a successful biometric authentication of a probe fingerprint of a subject, the person’s particulars are retrieved, encoded in a json object and returned to the webpage for display as a message and populating the fields first name, second name and employee number.

#If Fingerprint Authentication is Successful
	statusVal = 1
	personPart[0] = row.fname
	personPart[1] = row.sname
	personPart[2] = row.empno
	personPart[3] = row.id
	personPart[4] = statusVal
	print(row.fname, row.sname, row.empno, row.id, statusVal)
	print(personPart[4])
	
	if statusVal == 1:
		print("SUCCESS")
		print(personPart)
		return JsonResponse({'status':'OK', 'funame':personPart[0], 'suname':personPart[1], 'empno':personPart[2]})
	elif statusVal < 1:
		print("FAIL")
		print(personPart)
		return JsonResponse({'status':'OK', 'funame':personPart[0], 'suname':personPart[1], 'empno':personPart[2]})

def validateentry(request):
    pempno = request.GET.get('empno', None)
    data = {
        'empnoexists': users.objects.filter(empno__iexact=pempno).exists()
    }
    return JsonResponse(data)
Python Django Biometric app views file

urls . py file

In the urls . py file the url for starting the enrollment and authentication web pages of the Python Django Biometric Authentication app are defined.

enrollment launches the enrollment page when http://127.0.0.1:8000/jomutech/enrollment is run on the web browser

Similarly, authentication launches the enrollment page when http://127.0.0.1:8000/jomutech/authentication is run on the web browser

Below is the python code in the urls . py file

from django.urls import path
from . import views

urlpatterns = [
	path('', views.home, name="jomutech-home"),
	path('enrollment', views.enroll, name="jomutech-enrollment"),
	path('authentication', views.authenticate, name="jomutech-authentication"),
	path('enrolluser', views.registeruser, name="jomutech-register-user"),
	path('authenticateuser', views.authenticateuser, name="jomutech-authenticate-user"),
	path('validateentry', views.validateentry, name='jomutech-validate-user'),
]
Python Django Biometric urls for the launching the Jomutech App Web Pages for Biometric Enrollment and Biometric Authentication

site settings . py file

settings . py file showing installed jomutech django biometric authentication app

site settings py file showing installed jomutech bometrics authentication app

site settings . py file showing django biometric configs for MySQL Database

site settings py file showing django biometric configs for MySQL database backend

apps . py file

apps. py file showing the name of the site’s app called jomutech

See below screenshot

apps py file for jomutech django biometric authentication app

How to Register and Enroll Biometric Fingerprints of a User in Python Django Biometric Enrollment PACK

It is that simple!

Python Django Biometric Authentication Site and Jomutech App

See picture below for visual graphics of how your command prompt will look like.

In my case this is how I would go about Registering and Enrolling Biometric Fingerprints of a User on Python Django

First, I would make sure that I have a DigitalPersona Fingerprint Scanner connected to my Computer.

Thereafter, I would then open Command Prompt by running CMD.exe from the Search Programs and Files option after clicking on the start button of my windows.

With Command Prompt now open, I will change directory to F:\DJANGO_BIOMETRIC_AUTHENTICATION where I currently have my Django Python site with my Python Django Biometric App inside.

Inside the F:\DJANGO_BIOMETRIC_AUTHENTICATION directory is where my Django Python site’s manage.py file is located. I will need this file, manage.py to fire up my Python Django Server.

Once inside my site’s folder, I will then start the Django Python Server by running python manage.py runserver

With Server started, I would then open my web browser and at the web address type the URL for enrollment defined in the urs.py file of my Django Python App. My Django Python’s URL for enrollment is http://127.0.0.1:8000/jomutech/enrollment

With my Python Django Biometric app’s Enrollment page open, I will then proceed to Register and Enroll the Biometric Fingerprints of a User and finally click the Register button to save their Particulars and Biometric Data into the MySQL database back-end.

Starting Python Django Biometric Authentication Server

How to Authenticate a User using Biometric Fingerprints in Python Django Biometric Authentication PACK

It is that easy!

Here is how I would go about Authenticating Users with Biometric Fingerprints in Python Django

To begin with, I would ascertain that I have already connected a DigitalPersona Fingerprint Scanner to my Computer.

I would then open Command Prompt in Windows

After Command Prompt is opened, I will then change directory to F:\DJANGO_BIOMETRIC_AUTHENTICATION where my Django Python site runs from

In the F:\DJANGO_BIOMETRIC_AUTHENTICATION directory is where manage.py used to run Python Django Server is situated.

Thereafter, I will then start the Django Python Server by running python manage.py runserver

Once the Python Django Server is started, I would then open my web browser and at the web address type the URL for Biometric Authentication defined in the urs.py file of my Django Python App. The Python Django’s URL for Authentication in my app is http://127.0.0.1:8000/jomutech/enrollment

With my Python Django Biometric app’s Authentication page open, I will then proceed to Authenticate Users Biometrically using their Fingerprints.

Here is a full Youtube video clip showing how to Register User particulars, Enroll their Biometric Fingerprints and Authenticate them with their Biometric Fingerprints in a Python Django Web Application using a DigitalPersona Fingerprint Scanner.

Python Biometric Enrollment and Authentication Youtube Video Clip

Requirements for Installing and Integrating with Python Django Biometric Authentication for Windows

Windows Computer Server Architecture Type

Windows Computer Server RAM

Windows Computer Server Processor Cores

Windows Server Operating System

Client Computers Windows Operating System

Web Server Supported

Scripting Language Supported

Windows Server Computer Database back-end

Fingerprint Scanners

Digital Persona Fingerprint Scanner

Important Factors to consider before Shopping for a Biometric Fingerprint Scanner for use in your Web Biometric Authentication

Hey, that’s all! This is where the road ends.

Here are some screenshots of Python Django Biometric Authentication PACK I developed.

Photos and Screenshots of Python Django Biometric Fingerprint Enrollment

Python Django Biometric Fingerprint Enrollment
Python Django Biometric Fingerprint Enrollment Process
Python Django Biometric Fingerprint Enrollment Complete

Photos and Screenshots of Python Django Biometric Fingerprint Authentication

Python Django Biometric Fingerprint Authentication
Python Django Biometric Fingerprint Authentication showing Fingerprint Match NOT Found
Python Django Biometric Fingerprint Authentication Fingerprint Matched Successfully

Some of the Organizations that I have Helped integrate Biometrics in their Software Systems

Struggling with your Python Django Web Biometric Integration

Are you struggling to get your Python Django Web Biometric integration working?

How about I help you cut short the time wasted and get this headache out of your way?

Reach out to me now!

Joseph Mwema’s Email Address and YouTube Channel’s QR Code
Exit mobile version