Python 3.4, Django 1.7, Windows apache 2.4.12
I am trying to list all files on a Windows shared drive (which is restricted to certain users), and later write couple of files to the shared drive.
I am using os.listdir to do this. It works well if I just run the web app on my machine, but once it's deployed on the actual server it will stop working.
The problem is the permission on the Windows shared drive. User has to login first so I do have their username and password.
My question is how to supply os.listdir with username and password?
I tried os.listdir('//windows/share/drive/dir@domanin/username:password') but the system will try to look for the file instead of passing username and password.
Does any one know how to solve this? Or I need to map the drive (how do I map drive with credential?), list files, write files, then disconnect the mapped drive?
Thank you so much.