Ticket #6897: newstyledocs.diff
File newstyledocs.diff, 1.2 KB (added by , 17 years ago) |
---|
-
docs/authentication.txt
1056 1056 The ``authenticate`` method takes credentials as keyword arguments. Most of 1057 1057 the time, it'll just look like this:: 1058 1058 1059 class MyBackend :1059 class MyBackend(object): 1060 1060 def authenticate(self, username=None, password=None): 1061 1061 # Check the username/password and return a User. 1062 1062 1063 1063 But it could also authenticate a token, like so:: 1064 1064 1065 class MyBackend :1065 class MyBackend(object): 1066 1066 def authenticate(self, token=None): 1067 1067 # Check the token and return a User. 1068 1068 … … 1084 1084 from django.conf import settings 1085 1085 from django.contrib.auth.models import User, check_password 1086 1086 1087 class SettingsBackend :1087 class SettingsBackend(object): 1088 1088 """ 1089 1089 Authenticate against the settings ADMIN_LOGIN and ADMIN_PASSWORD. 1090 1090 … … 1133 1133 The simple backend above could implement permissions for the magic admin fairly 1134 1134 simply:: 1135 1135 1136 class SettingsBackend :1136 class SettingsBackend(object): 1137 1137 1138 1138 # ... 1139 1139