Re: How to locate the OS user name? [newbie]

2010-03-25 Thread Baurzhan Ismagulov
On Thu, Mar 25, 2010 at 08:27:37AM -0700, BobAalsma wrote:
> I am trying to build a Django application to centralise the
> information gathered by this unstable programme, but in some cases I
> need to refer to the stored files. So I want to store the
> "originating" OS user name in the database, along with the other
> information.

What about authenticating those users in your Django app?

With kind regards,
-- 
Baurzhan Ismagulov
http://www.kz-easy.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-25 Thread Benjamin Reitzammer
Hi Bob,
this not a Django specific question/problem but more a general Python question.
The information you are looking for is most likely located in the
os.environ object.
So take a look at  this in your python commandline/shell

>>> import os
>>> [i for i in os.environ.items()]

and look for the item that contains the username you are looking for.


HTH & Cheers

Benjamin



On Thu, Mar 25, 2010 at 16:27, BobAalsma  wrote:
> I work as a single person on a single machine. I use an unstable
> programme that requires me to employ more than one OS user. The
> programme will store some files locally (in each specific user
> environment).
>
> I am trying to build a Django application to centralise the
> information gathered by this unstable programme, but in some cases I
> need to refer to the stored files. So I want to store the
> "originating" OS user name in the database, along with the other
> information.
>
> So yes, there are concurrent users;  I know I will never use the same
> user name twice; it is a single machine solution, not using any
> network - I think there is no security problem to be solved here.
>
> I have looked at the documentation and forums, but could not find an
> answer to my question.
>
> Regards,
> Bob
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-25 Thread BobAalsma
I'd prefer not to as I keep switching between 15-20 users and find the
log in of the OS quite enough, thank you.
My beautiful but unstable programme makes it a good idea to
periodically fully log out and log in, say twice a day...

On Mar 25, 4:47 pm, Baurzhan Ismagulov  wrote:
> On Thu, Mar 25, 2010 at 08:27:37AM -0700, BobAalsma wrote:
> > I am trying to build a Django application to centralise the
> > information gathered by this unstable programme, but in some cases I
> > need to refer to the stored files. So I want to store the
> > "originating" OS user name in the database, along with the other
> > information.
>
> What about authenticating those users in your Django app?
>
> With kind regards,
> --
> Baurzhan Ismagulovhttp://www.kz-easy.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-25 Thread BobAalsma
Hi Benjamin,

Thanks, I'll have look.

Bob

On Mar 25, 4:43 pm, Benjamin Reitzammer  wrote:
> Hi Bob,
> this not a Django specific question/problem but more a general Python 
> question.
> The information you are looking for is most likely located in the
> os.environ object.
> So take a look at  this in your python commandline/shell
>
> >>> import os
> >>> [i for i in os.environ.items()]
>
> and look for the item that contains the username you are looking for.
>
> HTH & Cheers
>
> Benjamin
>
> On Thu, Mar 25, 2010 at 16:27, BobAalsma  wrote:
> > I work as a single person on a single machine. I use an unstable
> > programme that requires me to employ more than one OS user. The
> > programme will store some files locally (in each specific user
> > environment).
>
> > I am trying to build a Django application to centralise the
> > information gathered by this unstable programme, but in some cases I
> > need to refer to the stored files. So I want to store the
> > "originating" OS user name in the database, along with the other
> > information.
>
> > So yes, there are concurrent users;  I know I will never use the same
> > user name twice; it is a single machine solution, not using any
> > network - I think there is no security problem to be solved here.
>
> > I have looked at the documentation and forums, but could not find an
> > answer to my question.
>
> > Regards,
> > Bob
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-25 Thread BobAalsma
YES!

Works beautifully, thanks.

On the newbie part: how could I have found this?
I did find the os.environ and you've helped me discover how to look
inside, but what if I need something completely different?

Regards,
Bob

On Mar 25, 4:43 pm, Benjamin Reitzammer  wrote:
> Hi Bob,
> this not a Django specific question/problem but more a general Python 
> question.
> The information you are looking for is most likely located in the
> os.environ object.
> So take a look at  this in your python commandline/shell
>
> >>> import os
> >>> [i for i in os.environ.items()]
>
> and look for the item that contains the username you are looking for.
>
> HTH & Cheers
>
> Benjamin
>
> On Thu, Mar 25, 2010 at 16:27, BobAalsma  wrote:
> > I work as a single person on a single machine. I use an unstable
> > programme that requires me to employ more than one OS user. The
> > programme will store some files locally (in each specific user
> > environment).
>
> > I am trying to build a Django application to centralise the
> > information gathered by this unstable programme, but in some cases I
> > need to refer to the stored files. So I want to store the
> > "originating" OS user name in the database, along with the other
> > information.
>
> > So yes, there are concurrent users;  I know I will never use the same
> > user name twice; it is a single machine solution, not using any
> > network - I think there is no security problem to be solved here.
>
> > I have looked at the documentation and forums, but could not find an
> > answer to my question.
>
> > Regards,
> > Bob
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-25 Thread piz...@gmail.com
Check the module index in the python website: http://docs.python.org/ 
modindex.html


There you will find everything about python modules like sys, os, and  
others.


Regards,
Oscar C.

El 25/03/2010, a las 18:28, BobAalsma escribió:


YES!

Works beautifully, thanks.

On the newbie part: how could I have found this?
I did find the os.environ and you've helped me discover how to look
inside, but what if I need something completely different?

Regards,
Bob


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-25 Thread BobAalsma
OK, found it - thanks!

Regards,
Bob

On Mar 25, 6:40 pm, "piz...@gmail.com"  wrote:
> Check the module index in the python website:http://docs.python.org/
> modindex.html
>
> There you will find everything about python modules like sys, os, and  
> others.
>
> Regards,
> Oscar C.
>
> El 25/03/2010, a las 18:28, BobAalsma escribió:
>
> > YES!
>
> > Works beautifully, thanks.
>
> > On the newbie part: how could I have found this?
> > I did find the os.environ and you've helped me discover how to look
> > inside, but what if I need something completely different?
>
> > Regards,
> > Bob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-25 Thread BobAalsma
Hmm, on second thoughts...

I tested from the shell in a few user environements and it worked.

However, when applying this to Django, all users show the user name of
the user running the server.

Hindsight makes this logical, as the other users only use their
browser, not their own local python.

So I think now the question seems to be "how to extract the OS user
name from the browser environment?"

Regards,
Bob


On Mar 25, 7:06 pm, BobAalsma  wrote:
> OK, found it - thanks!
>
> Regards,
> Bob
>
> On Mar 25, 6:40 pm, "piz...@gmail.com"  wrote:
>
> > Check the module index in the python website:http://docs.python.org/
> > modindex.html
>
> > There you will find everything about python modules like sys, os, and  
> > others.
>
> > Regards,
> > Oscar C.
>
> > El 25/03/2010, a las 18:28, BobAalsma escribió:
>
> > > YES!
>
> > > Works beautifully, thanks.
>
> > > On the newbie part: how could I have found this?
> > > I did find the os.environ and you've helped me discover how to look
> > > inside, but what if I need something completely different?
>
> > > Regards,
> > > Bob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-25 Thread BobAalsma
Hmm, on second thoughts...

I tested from the shell in a few user environements and it worked.

However, when applying this to Django, all users show the user name of
the user running the server.

Hindsight makes this logical, as the other users only use their
browser, not their own local python.

So I think now the question seems to be "how to extract the OS user
name from the browser environment?"

Regards,
Bob


On Mar 25, 7:06 pm, BobAalsma  wrote:
> OK, found it - thanks!
>
> Regards,
> Bob
>
> On Mar 25, 6:40 pm, "piz...@gmail.com"  wrote:
>
> > Check the module index in the python website:http://docs.python.org/
> > modindex.html
>
> > There you will find everything about python modules like sys, os, and  
> > others.
>
> > Regards,
> > Oscar C.
>
> > El 25/03/2010, a las 18:28, BobAalsma escribió:
>
> > > YES!
>
> > > Works beautifully, thanks.
>
> > > On the newbie part: how could I have found this?
> > > I did find the os.environ and you've helped me discover how to look
> > > inside, but what if I need something completely different?
>
> > > Regards,
> > > Bob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-25 Thread BobAalsma
In addition:
So maybe Baurzhan was right: using a database login (explicit or
implicit) could be the easier solution to build.

Regards,
Bob

On Mar 26, 7:32 am, BobAalsma  wrote:
> Hmm, on second thoughts...
>
> I tested from the shell in a few user environements and it worked.
>
> However, when applying this to Django, all users show the user name of
> the user running the server.
>
> Hindsight makes this logical, as the other users only use their
> browser, not their own local python.
>
> So I think now the question seems to be "how to extract the OS user
> name from the browser environment?"
>
> Regards,
> Bob
>
> On Mar 25, 7:06 pm, BobAalsma  wrote:
>
> > OK, found it - thanks!
>
> > Regards,
> > Bob
>
> > On Mar 25, 6:40 pm, "piz...@gmail.com"  wrote:
>
> > > Check the module index in the python website:http://docs.python.org/
> > > modindex.html
>
> > > There you will find everything about python modules like sys, os, and  
> > > others.
>
> > > Regards,
> > > Oscar C.
>
> > > El 25/03/2010, a las 18:28, BobAalsma escribió:
>
> > > > YES!
>
> > > > Works beautifully, thanks.
>
> > > > On the newbie part: how could I have found this?
> > > > I did find the os.environ and you've helped me discover how to look
> > > > inside, but what if I need something completely different?
>
> > > > Regards,
> > > > Bob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-26 Thread BobAalsma
In addition:
So maybe Baurzhan was right: using a database login (explicit or
implicit) could be the easier solution to build.

Regards,
Bob

On Mar 26, 7:32 am, BobAalsma  wrote:
> Hmm, on second thoughts...
>
> I tested from the shell in a few user environements and it worked.
>
> However, when applying this to Django, all users show the user name of
> the user running the server.
>
> Hindsight makes this logical, as the other users only use their
> browser, not their own local python.
>
> So I think now the question seems to be "how to extract the OS user
> name from the browser environment?"
>
> Regards,
> Bob
>
> On Mar 25, 7:06 pm, BobAalsma  wrote:
>
> > OK, found it - thanks!
>
> > Regards,
> > Bob
>
> > On Mar 25, 6:40 pm, "piz...@gmail.com"  wrote:
>
> > > Check the module index in the python website:http://docs.python.org/
> > > modindex.html
>
> > > There you will find everything about python modules like sys, os, and  
> > > others.
>
> > > Regards,
> > > Oscar C.
>
> > > El 25/03/2010, a las 18:28, BobAalsma escribió:
>
> > > > YES!
>
> > > > Works beautifully, thanks.
>
> > > > On the newbie part: how could I have found this?
> > > > I did find the os.environ and you've helped me discover how to look
> > > > inside, but what if I need something completely different?
>
> > > > Regards,
> > > > Bob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to locate the OS user name? [newbie]

2010-03-26 Thread Baurzhan Ismagulov
On Thu, Mar 25, 2010 at 11:32:46PM -0700, BobAalsma wrote:
> So I think now the question seems to be "how to extract the OS user
> name from the browser environment?"

If you don't mind logging in once, a cookie could be one solution
(Django does this by default, AFAIK).

With kind regards,
-- 
Baurzhan Ismagulov
http://www.kz-easy.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.