Fetch Device Name

How Can I Fetch User Device Name with Django Web App?
Device Username - Like For Windows It will be like DVDMSA-KK.

Please be more specific and detailed about what you’re trying to do here. What do you mean by “User device name”?

You’re still not clear. Are you referring to the Windows system name? If so, that’s not something that Django can fetch from a system.
It might be more helpful if you describe what you’re trying to accomplish here.

My requirement is to fetch logged in user computer name in django web app.
The Computer Name is like below picture

KenWhitesell, Could you help me please!

To the best of my knowledge, this isn’t something you can do from the server side in Django. If you’re perhaps a little more detailed about what you’re trying to accomplish by doing this and why, I might be able to offer some suggestions. But as it is, the way you’re asking this, my answer is it can’t be done. There is no requirement within the http specification saying that that information must be supplied by the browser.

Hi 4akhilkumar, I agree with Ken. Also, I don’t think this is something you can easily do on the client side either. I did some searching and the best answer I found is to use ActiveX objects which would require the user to change a security setting.

Side note - it may be possible to find that information if you’re using SPNEGO authentication in an Active Directory environment, under the assumption that your web server is also a member of that domain.
(I’m not sure about that, and it’s been more than 14 years since I’ve worked with a non-.NET web app using it, so my memory on the specifics are a bit vague.)

Interesting, I’ve never heard of that. Though my AD experience is pretty limited.

I wish I could say the same… :roll_eyes:

1 Like

Hello All !
Thank you for your response and suggestions. When I checked my google account i.e., In Security Page → Your Devices. Here they displayed my exact computer name. I didn’t understand that In which way they are fetching it?
I tried using socket hostname() in python. It is displaying the hostname (Computer Name) on which my Django project is running. While I’m running my Django Project in my device it shown mine but when I run my Django Project on Heroku it displayed Heroku’s.

Do anyone have any idea that how google is fetching my computer name?

To directly answer your first question, Google isn’t fetching it, Chrome is sending it - to Google.

The best that I’ve been able to determine, based upon some very quick and ad-hoc testing, is that Google has some code within Chrome that will send that information to Google. If I’ve done this correctly, you can demonstrate this yourself - get Google to forget a computer, delete all your cookies and cache, then log on to Google using Firefox. Google will not learn the device name. (This was a rather quick test I ran, and I may have missed something along the way, but that’s how it appeared to be for me.) As it stands right now, of the six systems I use most frequently on the internet, Google has the host name for only 3 of them.
So my best guess is that this is just another “back door” that Google has injected into Chrome for gathering data about you and your internet usage. This means that even if Google documented this interface, it’s still not perfect, not guaranteed to get you the information you’re looking for, and at best will only work for people using Chrome.

1 Like

How I can detect the unusual (suspicious) login activity of a user. I mean based on what I can detect it? I’m collecting this data when the user logged In.

  1. IP Address
  2. OS Details
  3. Browser Name
    Is there any other data that I can use to detect unusual (suspicious) login activity. Or these are enough to detect it?

IP address is meaningless for public facing sites, other than for broad categorization of location - and even then it’s not necessarily “valid”.

OS Details and Browser Name are whatever the person on the far end want them to be. If they’re a “malicious actor”, they’re either going to use something standard or common such as to not raise suspicion - and possibly rotate them so it’s not consistent across uses.

The only real means is by analysis of the URLs being referenced and the data being posted to those URLs. Everything else fits into the category of “Let’s do something to make it look like we’re doing something - even though we’re not really doing anything to protect ourselves.”