Django Biometric scanning

Is there any library that I can use to add biometric field into a django model field, so that when user plugged in biometric scanner into a computer, that django model field would allow me to scan user finger and store it into a database and even viewing it in a template.

I have try using this method:

I created a python file into my app and named it: biometric_field.py:

Class BiometricField(models.Model):
def init(self, *args, **kwargs):
kwargs[‘max_length’] = 1000
super().init(*args, **kwargs)
def db_type(self, connection):
return ‘binary’

And add it to the model like any other field:

From .biometric_field import BiometricField

Class Primary(models.Model):
first_name = models.CharField(max_length=20)
second_name = models.CharField(max_length=20)
class_of_student = models.CharField(max_length=20)
year_of_graduations = Foreignkey(PrimaryAlbum, on_delete=models.CASCADE )
finger_print_first = BiometricField()

But using that method was completely not scalable, because, there is no way to communicate with a hardware that would allow us to scan user finger, do you have any idea or method that we can use to make that happen in django or any python libraries that is good with django?

Django runs on the server, not in the browser on the client.

You would need to find a JavaScript library that allows you to interface with the biometric scanner on the user’s computer, sending that information to the server.

1 Like

How can I do this? And what type of JavaScript library should I use to make that happen? I want to display fingerprint in the Primary modelForm.

I have no idea. That’s going to be an issue with the biometric scanner, the operating system being used by the user, the libraries that the scanner vendor provides, and any information that they may make available to the JavaScript engine running in a particular browser.

This is all completely outside the realm of Django. On the server side, it doesn’t matter whether you would be using Django, Php, Java, ASP, whatever - all this research depends strictly upon what’s happening in the user’s computer.

(Note - this likely means too that you might need to write different code for different biometric devices.)

Once you have it figured out on the client side, then you can determine what you might be able to do with it on the server. It’s all going to depend upon what information is provided to you. (Note: You might not be getting an “image” from the browser - it may just be some type of data structure.)

While this is very important thing to view the finger in the template, I think django can provide this field in the future. What if the fingerprint would be use in the CounterIntelligence system, or for example: in the schools to verify student Fingerprint?

Thanks for help Mr: KenWhitesell.

Again, that work is all done in the browser.

Django can store data sent to it by the browser, but Django cannot grab data from the browser.

(The browser must push data to the server. The server cannot pull data from the browser.)

It doesn’t matter why you’re trying to do this. The fundamental design of the HTTP protocol does not provide any mechanism for the server to directly access the hardware sending requests to it. You would need to write a custom client for that to occur.

1 Like

We actually faced the same issue when our Django application required interfacing with a fingerprint scanner. We pretty much followed what @KenWhitesell said. We bring fingerprint scanner data to the server, i.e., fingerprint template (which is alphanumeric) and other image metrics, from our front-end using javascript and AJAX. We then push the data to our database serverside.

Authentication is also done in a similar fashion. We get the fingerprint from the front-end and process/compare it serverside before responding back with success or failure.

We are still figuring out how to optimize the authentication process and make print comparisons faster as it is limited to some extent by the vendor who provides the scanner and the associated firmware for fingerprint authentication.

@atrityuser93 What is the best way to store data in the PostgreSQL database and how one can authenticate a user after he punches the expression?
I want to use for attendance management system using a Digital Persona device as a fingerprint reader.

hi @drivemetech, have u found out any idea how to implement fingerprint biometric? i want to know how is it works