1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 """
18 Django authentification application to *with openid using django auth contrib/.
19
20 This application allow a user to connect to you website with :
21 * legacy account : username/password
22 * openid url
23 """
24
25 from django.conf import settings
26 from django.core.exceptions import ImproperlyConfigured
27
28 try:
29 from django.utils.importlib import import_module
30 except ImportError:
31
32 from madrona.openid.utils.importlib import import_module
33
34 __version__ = "1.0.1"
35
36
37 if not hasattr(settings, 'OPENID_STORE') or not settings.OPENID_STORE:
38 settings.OPENID_STORE = 'madrona.openid.openid_store.DjangoOpenIDStore'
39
41 i = path.rfind('.')
42 module, attr = path[:i], path[i + 1:]
43 try:
44 mod = import_module(module)
45 except ImportError, e:
46 raise ImproperlyConfigured('Error importing openid store %s: "%s"' % (module, e))
47 except ValueError, e:
48 raise ImproperlyConfigured('Error importing openid store. Is OPENID_STORE '
49 'a correctly defined list or tuple?')
50 try:
51 cls = getattr(mod, attr)
52 except AttributeError:
53 raise ImproperlyConfigured('Module "%s" does not define a "%s" '
54 'openid store' % (module, attr))
55 return cls
56
57 DjangoOpenIDStore = load_store(settings.OPENID_STORE)
58