django的imap身份验证后端
django-imapauth的Python项目详细描述
=====
django imapauth
==
django imapauth是django的一个简单的imap身份验证后端。
quick start
--
要求:
*django 1.4.3(已测试)。
1。安装应用程序
pypi version
```
pip install django imapauth
````
development version
`````
pip install-e git+http://github.com/ouhouhsami/django imapauth.git egg=django imapauth
```
2。将“imapauth.backends.imapbackend”``添加到“authentication\u backends”设置
```
authentication\u backends=(
“imapauth.backends.imapbackend”,
“django.contrib.auth.backends.modelbackend”,
````
3。在您的设置中添加“imapauth host`````
````
imapauth host='我的imap```
```
django imapauth的用法
----
,当用户尝试在您的系统中进行身份验证时,``imapbackend``将尝试使用其凭据连接到``imapauth host`````。
小心,并不是因为用户经过身份验证才可以访问管理站点。为此,请参考下面的示例,并在“authentication-u-backends”中使用“customimapbackend”:
from imapauth.backends导入imapbackend
class customimapbackend(imapbackend):
def authenticate(self,username=none,password=none):
user=super(customimapbackend,self).authenticate(用户名,密码)
如果用户为none:
返回none
user.is_staff=true
user.save()
返回user
进一步信息
----
http://www.djangorks.com/tutorials/creating-a-custom-authentication-backend/creating-the-imap-authentication-backend.html
django imapauth
==
django imapauth是django的一个简单的imap身份验证后端。
quick start
--
要求:
*django 1.4.3(已测试)。
1。安装应用程序
pypi version
```
pip install django imapauth
````
development version
`````
pip install-e git+http://github.com/ouhouhsami/django imapauth.git egg=django imapauth
```
2。将“imapauth.backends.imapbackend”``添加到“authentication\u backends”设置
```
authentication\u backends=(
“imapauth.backends.imapbackend”,
“django.contrib.auth.backends.modelbackend”,
````
3。在您的设置中添加“imapauth host`````
````
imapauth host='我的imap```
```
django imapauth的用法
----
,当用户尝试在您的系统中进行身份验证时,``imapbackend``将尝试使用其凭据连接到``imapauth host`````。
小心,并不是因为用户经过身份验证才可以访问管理站点。为此,请参考下面的示例,并在“authentication-u-backends”中使用“customimapbackend”:
from imapauth.backends导入imapbackend
class customimapbackend(imapbackend):
def authenticate(self,username=none,password=none):
user=super(customimapbackend,self).authenticate(用户名,密码)
如果用户为none:
返回none
user.is_staff=true
user.save()
返回user
进一步信息
----
http://www.djangorks.com/tutorials/creating-a-custom-authentication-backend/creating-the-imap-authentication-backend.html