Is there a way in Python / Django to get the username of the current Windows user from an application that does not work locally?
UPDATE: sorry to clarify, by this I mean the Windows username for the user viewing the web page, and not the user starting the server.
I tried both:
current_user = os.environ.get("USERNAME") current_user_getpass = getpass.getuser()
But I think that they return the name of the user starting the server.
Thanks!
FURTHER UPDATE: I don't care about security. It doesn’t matter if users cheat on the username. What's the matter, it's convenience. I just need a way to get a username without having to tinker with passwords or install client software. Any ideas?
source share