# Fetch Device Name

**URL:** <https://forum.djangoproject.com/t/fetch-device-name/8583>\
**Category:** Using Django\
**Created:** [July 1, 2021, 3:27am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583 "2021-07-01T03:27:51Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![4akhilkumar](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/4akhilkumar/32/5008_2.png) [@4akhilkumar](https://forum.djangoproject.com/u/4akhilkumar)\
**Post date:** [July 1, 2021, 3:27am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/1 "2021-07-01T03:27:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 1, 2021, 3:38am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/2 "2021-07-01T03:38:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 1, 2021, 4:39am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/4 "2021-07-01T04:39:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![4akhilkumar](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/4akhilkumar/32/5008_2.png) [@4akhilkumar](https://forum.djangoproject.com/u/4akhilkumar)\
**Post date:** [July 1, 2021, 4:51am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/5 "2021-07-01T04:51:27Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/0/05164b39b8e46d49d909a1a1b559fd2afd625343.png)

---

<div class="post-metadata">

**Author:** ![4akhilkumar](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/4akhilkumar/32/5008_2.png) [@4akhilkumar](https://forum.djangoproject.com/u/4akhilkumar)\
**Post date:** [July 1, 2021, 9:12am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/6 "2021-07-01T09:12:51Z")

</div>

KenWhitesell, Could you help me please!

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 1, 2021, 11:26am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/7 "2021-07-01T11:26:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![CodenameTim](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/codenametim/32/31507_2.png) [@CodenameTim](https://forum.djangoproject.com/u/CodenameTim)\
**Post date:** [July 1, 2021, 1:53pm UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/8 "2021-07-01T13:53:14Z")

</div>

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](https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/279777/get-the-user-computer-name-by-javascript/799490) is to use ActiveX objects which would require the user to change a security setting.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 1, 2021, 2:15pm UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/9 "2021-07-01T14:15:51Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![CodenameTim](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/codenametim/32/31507_2.png) [@CodenameTim](https://forum.djangoproject.com/u/CodenameTim)\
**Post date:** [July 1, 2021, 2:29pm UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/10 "2021-07-01T14:29:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 1, 2021, 2:32pm UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/11 "2021-07-01T14:32:01Z")

</div>

I wish I could say the same… 🙄

---

<div class="post-metadata">

**Author:** ![4akhilkumar](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/4akhilkumar/32/5008_2.png) [@4akhilkumar](https://forum.djangoproject.com/u/4akhilkumar)\
**Post date:** [July 2, 2021, 1:33am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/12 "2021-07-02T01:33:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 2, 2021, 2:20am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/13 "2021-07-02T02:20:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![4akhilkumar](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/4akhilkumar/32/5008_2.png) [@4akhilkumar](https://forum.djangoproject.com/u/4akhilkumar)\
**Post date:** [July 2, 2021, 11:40am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/14 "2021-07-02T11:40:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 2, 2021, 11:46am UTC](https://forum.djangoproject.com/t/fetch-device-name/8583/15 "2021-07-02T11:46:10Z")

</div>

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.”
