{"id":27703,"library":"djangosaml2idp2","title":"djangosaml2idp","description":"SAML 2.0 Identity Provider for Django. Current version 0.9.1, released Jan 2025. Maintained on GitHub, monthly patch releases.","status":"active","version":"0.9.1","language":"python","source_language":"en","source_url":"https://github.com/xelixdev/djangosaml2idp","tags":["saml","identity-provider","django","sso"],"install":[{"cmd":"pip install djangosaml2idp2","lang":"bash","label":"Latest"}],"dependencies":[{"reason":"Required: Django web framework","package":"django","optional":false},{"reason":"Required: SAML library","package":"pysaml2","optional":false},{"reason":"Required: SAML integration utilities","package":"djangosaml2","optional":false}],"imports":[{"note":"Old name from v0.8.x","wrong":"from djangosaml2idp.models import IdentityProvider","symbol":"IdP","correct":"from djangosaml2idp.models import IdP"},{"note":"Renamed in v0.9.0","wrong":"from djangosaml2idp.settings import saml2idp_settings","symbol":"settings","correct":"from djangosaml2idp.conf import settings"},{"note":"No common mistake","symbol":"processors","correct":"from djangosaml2idp.processors import BaseProcessor"}],"quickstart":{"code":"# INSTALLED_APPS += ['djangosaml2idp']\n# urls.py\nfrom django.urls import path, include\nurlpatterns = [\n    path('saml2/', include('djangosaml2idp.urls')),\n]\n# settings.py\nSAML_IDP_CONFIG = {\n    'entity_id': 'https://your-idp.example.com/saml2/metadata/',\n    'acs_endpoint': 'https://your-idp.example.com/saml2/acs/',\n    'attribute_map': {\n        'email': 'email',\n        'username': 'username',\n    },\n}","lang":"python","description":"Add to INSTALLED_APPS, include URLs, and define SAML_IDP_CONFIG."},"warnings":[{"fix":"Replace 'IdentityProvider' with 'IdP' in imports and queries.","message":"In v0.9.0 the model class 'IdentityProvider' was renamed to 'IdP'. Any code referencing IdentityProvider must be updated.","severity":"breaking","affected_versions":"<0.9.0"},{"fix":"Move attribute map inside SAML_IDP_CONFIG dict.","message":"The setting 'SAML_IDP_ATTRIBUTE_MAP' is deprecated; use 'SAML_IDP_CONFIG['attribute_map']' instead.","severity":"deprecated","affected_versions":"<0.9.0"},{"fix":"Install with 'pip install djangosaml2idp2', then import as 'djangosaml2idp'.","message":"The package is installed as 'djangosaml2idp2' on PyPI, but the Python module is 'djangosaml2idp'. Ensure you import correctly.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure both are present and valid HTTPS URLs.","message":"SAML_IDP_CONFIG must include 'entity_id' and 'acs_endpoint' as full URLs. Missing these causes AttributeError on metadata endpoint.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"The module name is 'djangosaml2idp'. Install with 'pip install djangosaml2idp2' and import correctly.","cause":"Package installed as 'djangosaml2idp2' but import expects 'djangosaml2idp'.","error":"ModuleNotFoundError: No module named 'djangosaml2idp'"},{"fix":"Use 'from djangosaml2idp.conf import settings'.","cause":"Old import path was 'from djangosaml2idp.settings import saml2idp_settings'.","error":"AttributeError: module 'djangosaml2idp.conf' has no attribute 'settings'"},{"fix":"Ensure each service provider uses a unique entity_id in SAML_IDP_CONFIG.","cause":"IdP model 'entity_id' field is unique; duplicate entity IDs cause crash.","error":"django.db.utils.IntegrityError: (1062, \"Duplicate entry '...' for key 'djangosaml2idp_idp_entity_id...'\")"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}