django-web3-auth是一个可插入的django应用程序,可以通过以太坊钱包(la cryptokitties)登录/注册。用户通过使用钱包的私钥对会话密钥进行数字签名来进行身份验证。
django-web3-auth的Python项目详细描述
一、二、二、二、三、三、三、三、三、三、三、三、三、三、三、三、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、四、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、六、图片::https://badge.fury.io/py/django-web3-auth.svg
:目标:https://badge.fury.io/py/django-web3-auth
图片::https://travis-ci.org/bearle/django-web3-auth.svg?branch=master
:目标:https://travis ci.org/bearle/django-web3-auth
…图片::https://codecov.io/gh/bearle/django-web3-auth/branch/master/graph/badge.svg
:目标:https://codecov.io/gh/bearle/django-web3-auth
django-web3-auth是一个可插入的django应用程序,可以通过以太坊钱包(La Cryptokitties)登录/注册。用户通过使用钱包的私钥对会话密钥进行数字签名来进行身份验证。
…图片::https://github.com/bearle/django-web3-auth/blob/master/docs//u static/web3_auth_test.gif?raw=true
documentation
——
完整文档位于https://django-web3-auth.readthedocs.io.
example project
——
https://github.com/bearle/django-web3-auth/tree/master/example
查看回购协议并进入示例/目录。
还有一个自述文件供您检查。
features
--
*web3 api login,signup
*web3 django forms for signup,login
*检查以太坊地址有效性
*使用随机令牌签名作为PR的证明ivate密钥位置
*易于设置和使用(只需单击一次)
*自定义身份验证后端
*非常可自定义-使用django设置,允许自定义用户模型
*包含的普通javascript帮助程序
quickstart
----
django-web3-auth尚未发布,您需要要从存储库安装,请执行以下操作:
pip安装https://github.com/bearle/django-web3-auth/archive/master.zip
代码块::python
已安装的应用程序=(
…
'web3auth.apps.web3authconfig',
…
)
将"web3auth.backend.web3backend"设置为身份验证后端:
。代码块::python
authentication_backend s=[
'django.contrib.auth.backends.model backend',
'web3auth.backend.web3backend'
]
将用户模型的字段设置为用作eth地址提供程序:
。代码块::python
web3auth_user_address_field='用户名'
,如果您有一些其他字段希望出现在注册表单中,也可以添加它们:
…代码块::python
web3 auth_user_signup_fields=['email',]
add django-web3-auth的url模式:
……代码块::python
from web3auth将url导入为web3auth-urls
…
url(r'^',include(web3auth-urls)),
…
]
代码块::html
<;script src="{%static"web3auth/js/web3auth.js"%}">;
……代码块:javascript
='未定义'){
checkweb3(函数(loggedin){
如果(!loggedin){
警报("请解锁您的web3提供程序(可能是元掩码)")
}否则{
var login_url='{%url'web3auth_login_api'%};
web3login(login_url,console.log,console.log,console.log,console.log,console.log,function(resp){
console.log(resp);
window.location.replace(resp.redirect戥url);
}
}
}else{
alert('web3 missing');
}
如果您如有任何疑问,请访问示例应用程序https://github.com/bearle/django-web3-auth/tree/master/example
重要细节和常见问题解答。*如果设置自定义地址字段(web3auth_user_address_field),则该字段必须是唯一的(unique=true)。*
这是必需的,因为如果不是,则用户可以使用与另一个相同的地址注册新帐户,
这意味着用户现在可以作为这些帐户中的任何一个登录(有时是弄错了)。*如何处理用户密码或未设置密码*
项目中应该有一些代码使用"user.objects.make_random_password"生成密码,并将其发送到用户电子邮件。
或者,更好的是,向他们发送"还原密码"链接。
此外,还可以复制sig将视图添加到项目中,为其分配一个url,并添加相应的行以设置用户的密码。
<3。*为什么我要在留言上签名?我的钱包或者其他的口袋里都不需要!*
主要原因是,当使用DAPP时,您很可能在网站上没有帐户,只能使用Web3(元掩码)访问该帐户。
当使用Web3仅登录到用户帐户时,需要使用私钥(例如,签署随机消息)证明您的身份,
beca当我们有后台时,我们不能仅凭用户对公共地址的了解就信任他。
签名消息证明用户拥有与地址相关联的私钥。
::
source<;yourvirtualenv>;/bin/activate
(myenv)$pip install tox
(myenv)$tox
credits
----
呈现此包时使用的工具:
*Cookiecutter
*`Cookiecutter DjangoPackage`
。_ Cookiecutter:https://github.com/audreyr/Cookiecutter
。_` Cookiecutter djangoPackage`:https://github.com/pydanny/Cookiecutter djangoPackage
----
<0.1.0(2018-06-24)
++++++++++++++
:目标:https://badge.fury.io/py/django-web3-auth
图片::https://travis-ci.org/bearle/django-web3-auth.svg?branch=master
:目标:https://travis ci.org/bearle/django-web3-auth
…图片::https://codecov.io/gh/bearle/django-web3-auth/branch/master/graph/badge.svg
:目标:https://codecov.io/gh/bearle/django-web3-auth
django-web3-auth是一个可插入的django应用程序,可以通过以太坊钱包(La Cryptokitties)登录/注册。用户通过使用钱包的私钥对会话密钥进行数字签名来进行身份验证。
…图片::https://github.com/bearle/django-web3-auth/blob/master/docs//u static/web3_auth_test.gif?raw=true
documentation
——
完整文档位于https://django-web3-auth.readthedocs.io.
example project
——
https://github.com/bearle/django-web3-auth/tree/master/example
查看回购协议并进入示例/目录。
还有一个自述文件供您检查。
features
--
*web3 api login,signup
*web3 django forms for signup,login
*检查以太坊地址有效性
*使用随机令牌签名作为PR的证明ivate密钥位置
*易于设置和使用(只需单击一次)
*自定义身份验证后端
*非常可自定义-使用django设置,允许自定义用户模型
*包含的普通javascript帮助程序
quickstart
----
django-web3-auth尚未发布,您需要要从存储库安装,请执行以下操作:
pip安装https://github.com/bearle/django-web3-auth/archive/master.zip
代码块::python
已安装的应用程序=(
…
'web3auth.apps.web3authconfig',
…
)
将"web3auth.backend.web3backend"设置为身份验证后端:
。代码块::python
authentication_backend s=[
'django.contrib.auth.backends.model backend',
'web3auth.backend.web3backend'
]
将用户模型的字段设置为用作eth地址提供程序:
。代码块::python
web3auth_user_address_field='用户名'
,如果您有一些其他字段希望出现在注册表单中,也可以添加它们:
…代码块::python
web3 auth_user_signup_fields=['email',]
add django-web3-auth的url模式:
……代码块::python
from web3auth将url导入为web3auth-urls
url(r'^',include(web3auth-urls)),
…
]
代码块::html
<;script src="{%static"web3auth/js/web3auth.js"%}">;
……代码块:javascript
='未定义'){
checkweb3(函数(loggedin){
如果(!loggedin){
警报("请解锁您的web3提供程序(可能是元掩码)")
}否则{
var login_url='{%url'web3auth_login_api'%};
web3login(login_url,console.log,console.log,console.log,console.log,console.log,function(resp){
console.log(resp);
window.location.replace(resp.redirect戥url);
}
}
}else{
alert('web3 missing');
}
如果您如有任何疑问,请访问示例应用程序https://github.com/bearle/django-web3-auth/tree/master/example
重要细节和常见问题解答。*如果设置自定义地址字段(web3auth_user_address_field),则该字段必须是唯一的(unique=true)。*
这是必需的,因为如果不是,则用户可以使用与另一个相同的地址注册新帐户,
这意味着用户现在可以作为这些帐户中的任何一个登录(有时是弄错了)。*如何处理用户密码或未设置密码*
项目中应该有一些代码使用"user.objects.make_random_password"生成密码,并将其发送到用户电子邮件。
或者,更好的是,向他们发送"还原密码"链接。
此外,还可以复制sig将视图添加到项目中,为其分配一个url,并添加相应的行以设置用户的密码。
<3。*为什么我要在留言上签名?我的钱包或者其他的口袋里都不需要!*
主要原因是,当使用DAPP时,您很可能在网站上没有帐户,只能使用Web3(元掩码)访问该帐户。
当使用Web3仅登录到用户帐户时,需要使用私钥(例如,签署随机消息)证明您的身份,
beca当我们有后台时,我们不能仅凭用户对公共地址的了解就信任他。
签名消息证明用户拥有与地址相关联的私钥。
::
source<;yourvirtualenv>;/bin/activate
(myenv)$pip install tox
(myenv)$tox
credits
----
呈现此包时使用的工具:
*Cookiecutter
*`Cookiecutter DjangoPackage`
。_ Cookiecutter:https://github.com/audreyr/Cookiecutter
。_` Cookiecutter djangoPackage`:https://github.com/pydanny/Cookiecutter djangoPackage
----
<0.1.0(2018-06-24)
++++++++++++++