Re: Django and LDAP

2012-09-13 Thread Ivan Pavlović
Thank you sbrandt. I found the same thing, but i don't know how to use it.
Where do i need to copy the files and do i erase some lines of the code or
not, to make them as comments. I'm trying but i am not succeeding at making
it work...

Can you help me about that?

On Thu, Sep 13, 2012 at 10:16 AM, sbrandt wrote:

> Did you know there is django-auth-ldap which is a custom backend for
> authenticating users through LDAP?
> http://pypi.python.org/pypi/django-auth-ldap/
>
> I don't see the point why you fiddle around with writing code on your own.
> I'm using django-auth-ldap since one and a half year in production and it
> works like a charm.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/4Go12iWz_pEJ.
>
> To post to this group, send email to django-users@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-users@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: Django and LDAP

2012-09-11 Thread Ivan Pavlović
I appreciate it Thomas :)

On Wed, Sep 12, 2012 at 12:11 AM, Ivan Pavlović
wrote:

> Once again, thank you. If you have some advices or pointers where to start
> (besides the ones you've already mentioned), how to develop my knowledge,
> please feel free to share with me.
>
> Grateful
> Tony
>
>
> On Wed, Sep 12, 2012 at 12:05 AM, Mike Dewhirst wrote:
>
>> On 12/09/2012 7:49am, Ivan Pavlović wrote:
>>
>>> Thank you Mike for your answer. I started this topic, because i have an
>>> assignment at my Faculty, which requires connection between Django and
>>> an LDAP (assistant insisted on 389ds). I installed Django, enabled
>>> admin, logged in through Firefox. I can't make up my mind, do i need to
>>> connect Django and LDAP like so that all users from LDAP can login
>>> through e.g. localhost:8000/admin, or do i need to make a register/login
>>> page, where users from LDAP server can login and onlu admin can login
>>> from admin page? The second is mpre logical to me, but i don't know,
>>> because i am new to Django and Python.
>>>
>>
>> It is immaterial where it is hosted except localhost:8000 is usually the
>> development machine running the development server. It comes with a caveat
>> "not for production use". You really need a production web server for
>> production.
>>
>> Your other questions are unanswerable without a set of specs. You can use
>> the admin or not and you can use the login/auth with your own app and/or
>> the admin depending on the url you use. Users can be permitted to use the
>> admin or not depending on user.is_staff
>>
>> There is no substitute for getting started.
>>
>>
>>>
>>>
>>> On Tue, Sep 11, 2012 at 12:36 AM, Mike Dewhirst >> <mailto:mi...@dewhirst.com.au>**> wrote:
>>>
>>> On 11/09/2012 4:14am, Tony wrote:
>>>
>>> Hi everybody,
>>>
>>> I am new to Django and Python, and right now, i am going through
>>> the
>>> documentation. I have an assignment at my Faculty, where i need
>>> to
>>> install Django, 389ds LDAP server (where i have to store my
>>> users) and i
>>> need to somehow connect them two, so i can auth users from LDAP
>>> when
>>> logging into Django. i have read some documentation, and i saw a
>>> massive
>>> lines of code, add this, add that, and i don't get any of that.
>>>
>>>
>>> I think the best first step is to tightly specify your requirements.
>>> There are lots of different approaches and your choice of available
>>> open source depends a lot on what you want to do. For example, you
>>> may be interested in ldap group membership being related to Django
>>> groups.
>>>
>>> Being new to Python and Django isn't a problem. Look at Mark
>>> Pilgrim's Dive into Python (the first one which covers Python 2.x)
>>> then do the Django tutorials up to the point where the Django Admin
>>> is working for you. That will demonstrate "add this, add that" and
>>> make it easier for you. Also, install pip for fetching this and that!
>>>
>>> The Django Admin auth will happily/easily accept external auth
>>> backends.
>>>
>>> I have stopped using ldap nowadays but when I had it working the
>>> general principle employed was to query the ldap server and if it
>>> authenticated the offered userid and password AND the userid didn't
>>> exist in the Django user table, the backend inserted a new record.
>>>
>>>  >From my own experience I can recommend you start with a plan to
>>> unit test absolutely everything. The ldap side of things is tricky.
>>> Once you get your head around Python and Django you will really
>>> appreciate the nth degree of flexibility.
>>>
>>> Good luck
>>>
>>> Mike
>>>
>>>
>>>
>>> Can someone please help me with this issue, i'll be very
>>> grateful.
>>>
>>> Thank you
>>>
>>> --
>>> You received this message because you are subscribed to the
>>> Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/__**msg/django-users/-/__**
&g

Re: Django and LDAP

2012-09-11 Thread Ivan Pavlović
Once again, thank you. If you have some advices or pointers where to start
(besides the ones you've already mentioned), how to develop my knowledge,
please feel free to share with me.

Grateful
Tony

On Wed, Sep 12, 2012 at 12:05 AM, Mike Dewhirst wrote:

> On 12/09/2012 7:49am, Ivan Pavlović wrote:
>
>> Thank you Mike for your answer. I started this topic, because i have an
>> assignment at my Faculty, which requires connection between Django and
>> an LDAP (assistant insisted on 389ds). I installed Django, enabled
>> admin, logged in through Firefox. I can't make up my mind, do i need to
>> connect Django and LDAP like so that all users from LDAP can login
>> through e.g. localhost:8000/admin, or do i need to make a register/login
>> page, where users from LDAP server can login and onlu admin can login
>> from admin page? The second is mpre logical to me, but i don't know,
>> because i am new to Django and Python.
>>
>
> It is immaterial where it is hosted except localhost:8000 is usually the
> development machine running the development server. It comes with a caveat
> "not for production use". You really need a production web server for
> production.
>
> Your other questions are unanswerable without a set of specs. You can use
> the admin or not and you can use the login/auth with your own app and/or
> the admin depending on the url you use. Users can be permitted to use the
> admin or not depending on user.is_staff
>
> There is no substitute for getting started.
>
>
>>
>>
>> On Tue, Sep 11, 2012 at 12:36 AM, Mike Dewhirst > <mailto:mi...@dewhirst.com.au>**> wrote:
>>
>> On 11/09/2012 4:14am, Tony wrote:
>>
>> Hi everybody,
>>
>> I am new to Django and Python, and right now, i am going through
>> the
>> documentation. I have an assignment at my Faculty, where i need to
>> install Django, 389ds LDAP server (where i have to store my
>> users) and i
>> need to somehow connect them two, so i can auth users from LDAP
>> when
>> logging into Django. i have read some documentation, and i saw a
>> massive
>> lines of code, add this, add that, and i don't get any of that.
>>
>>
>> I think the best first step is to tightly specify your requirements.
>> There are lots of different approaches and your choice of available
>> open source depends a lot on what you want to do. For example, you
>> may be interested in ldap group membership being related to Django
>> groups.
>>
>> Being new to Python and Django isn't a problem. Look at Mark
>> Pilgrim's Dive into Python (the first one which covers Python 2.x)
>> then do the Django tutorials up to the point where the Django Admin
>> is working for you. That will demonstrate "add this, add that" and
>> make it easier for you. Also, install pip for fetching this and that!
>>
>> The Django Admin auth will happily/easily accept external auth
>> backends.
>>
>> I have stopped using ldap nowadays but when I had it working the
>> general principle employed was to query the ldap server and if it
>> authenticated the offered userid and password AND the userid didn't
>> exist in the Django user table, the backend inserted a new record.
>>
>>  >From my own experience I can recommend you start with a plan to
>> unit test absolutely everything. The ldap side of things is tricky.
>> Once you get your head around Python and Django you will really
>> appreciate the nth degree of flexibility.
>>
>> Good luck
>>
>> Mike
>>
>>
>>
>> Can someone please help me with this issue, i'll be very grateful.
>>
>> Thank you
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/__**msg/django-users/-/__**
>> 7ArlkeKjY0YJ<https://groups.google.com/d/__msg/django-users/-/__7ArlkeKjY0YJ>
>> 
>> <https://groups.google.com/d/**msg/django-users/-/**7ArlkeKjY0YJ<https://groups.google.com/d/msg/django-users/-/7ArlkeKjY0YJ>
>> >.
>>
>> To post to this group, send email to
>> django-users@googlegroups.com
>> 
>> <mailto:django-users@**googlegroups.com
>> >.
>>
>> To unsubscribe from this gro

Re: Django and LDAP

2012-09-11 Thread Ivan Pavlović
Thank you Mike for your answer. I started this topic, because i have an
assignment at my Faculty, which requires connection between Django and an
LDAP (assistant insisted on 389ds). I installed Django, enabled admin,
logged in through Firefox. I can't make up my mind, do i need to connect
Django and LDAP like so that all users from LDAP can login through e.g.
localhost:8000/admin, or do i need to make a register/login page, where
users from LDAP server can login and onlu admin can login from admin page?
The second is mpre logical to me, but i don't know, because i am new to
Django and Python.



On Tue, Sep 11, 2012 at 12:36 AM, Mike Dewhirst wrote:

> On 11/09/2012 4:14am, Tony wrote:
>
>> Hi everybody,
>>
>> I am new to Django and Python, and right now, i am going through the
>> documentation. I have an assignment at my Faculty, where i need to
>> install Django, 389ds LDAP server (where i have to store my users) and i
>> need to somehow connect them two, so i can auth users from LDAP when
>> logging into Django. i have read some documentation, and i saw a massive
>> lines of code, add this, add that, and i don't get any of that.
>>
>
> I think the best first step is to tightly specify your requirements. There
> are lots of different approaches and your choice of available open source
> depends a lot on what you want to do. For example, you may be interested in
> ldap group membership being related to Django groups.
>
> Being new to Python and Django isn't a problem. Look at Mark Pilgrim's
> Dive into Python (the first one which covers Python 2.x) then do the Django
> tutorials up to the point where the Django Admin is working for you. That
> will demonstrate "add this, add that" and make it easier for you. Also,
> install pip for fetching this and that!
>
> The Django Admin auth will happily/easily accept external auth backends.
>
> I have stopped using ldap nowadays but when I had it working the general
> principle employed was to query the ldap server and if it authenticated the
> offered userid and password AND the userid didn't exist in the Django user
> table, the backend inserted a new record.
>
> From my own experience I can recommend you start with a plan to unit test
> absolutely everything. The ldap side of things is tricky. Once you get your
> head around Python and Django you will really appreciate the nth degree of
> flexibility.
>
> Good luck
>
> Mike
>
>
>
>> Can someone please help me with this issue, i'll be very grateful.
>>
>> Thank you
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/**msg/django-users/-/**7ArlkeKjY0YJ
>> .
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscribe@**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-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> 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-users@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.