Skip to main content
django-ldapdb - support for django models over LDAP
Copyright (c) 2009-2011, Bolloré Telecom
Copyright (c) 2013, Jeremy Lainé

[![Build Status](https://travis-ci.org/django-ldapdb/django-ldapdb.png)](https://travis-ci.org/django-ldapdb/django-ldapdb)

About
-----

_django-ldapdb_ is an LDAP database backend for Django. It allows you to
manipulate LDAP entries using Django's models. Declaring models using the
LDAP backend is very straightforward, you simply inherit from
_ldapdb.models.Model_ and declare the fields in the same way as for regular
models. You can even edit the LDAP entries using Django's admin interface.

_django-ldapdb_ requires Django version 1.2.x, 1.3.x, 1.4.x, 1.5.x, 1.6.x,
1.7.x or 1.8.x.

_django-ldapdb_ is distributed under the BSD license, see the LICENSE
file for details. See AUTHORS file for a full list of contributors.

Using django-ldapdb
-------------------

Add the following to your _settings.py_:

DATABASES = {
...
'ldap': {
'ENGINE': 'ldapdb.backends.ldap',
'NAME': 'ldap://ldap.nodomain.org/',
'USER': 'cn=admin,dc=nodomain,dc=org',
'PASSWORD': 'some_secret_password',
}
}
DATABASE_ROUTERS = ['ldapdb.router.Router']

If you want to access posixGroup entries in your application, you can add
something like this to your _models.py_:

from ldapdb.models.fields import CharField, IntegerField, ListField
import ldapdb.models

class LdapGroup(ldapdb.models.Model):
"""
Class for representing an LDAP group entry.
"""
# LDAP meta-data
base_dn = "ou=groups,dc=nodomain,dc=org"
object_classes = ['posixGroup']

# posixGroup attributes
gid = IntegerField(db_column='gidNumber', unique=True)
name = CharField(db_column='cn', max_length=200, primary_key=True)
members = ListField(db_column='memberUid')

def __str__(self):
return self.name

def __unicode__(self):
return self.name

_Important note_ : you _must_ declare an attribute to be used as the primary
key. This attribute will play a special role, as it will be used to build the
Relative Distinguished Name of the entry. For instance in the example above,
a group whose cn is _foo_ will have the DN _cn=foo,ou=groups,dc=nodomain,dc=org_.

Metadata

Release files for django-ldapdb 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-ldapdb 0.5.0
File Size Uploaded Provenance Actions
django-ldapdb-0.5.0.tar.gz 11.1 kB Without provenance Details for django-ldapdb-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-ldapdb 0.5.0
File Interpreter ABI Platform Actions
django_ldapdb-0.5.0-py3-none-any.whl Python 3 none any Details for django_ldapdb-0.5.0-py3-none-any.whl

Total release size: 31.9 kB

Release files / django-ldapdb-0.5.0.tar.gz

Download URL django-ldapdb-0.5.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b885622aea87da27d50f5105d5bd7411673d4b36aea9b201999515780fb8b6ae
BLAKE2b-256 checksum
How to use checksums
3185e94d8cd85df45316bc66e418b69280c6144b9742310af501a6226a76f28d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_ldapdb-0.5.0-py3-none-any.whl

Download URL django_ldapdb-0.5.0-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a62187262dbf5a804763547228ffbf26beeed719cd773eefc16eea81cb41e251
BLAKE2b-256 checksum
How to use checksums
7b5df04eeb39867901fe502cad108c0c2df67ce9e69fc40ed9b4ab7222ec713d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-ldapdb 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page