django-web3-auth is a pluggable Django app that enables login/signup via an Ethereum wallet (a la CryptoKitties). The user authenticates themselves by digitally signing the session key with their wallet's private key.
django-web3-auth has no releases yet, you'll need to install it from repository:
pip install https://github.com/atereshkin/django-web3-auth/archive/master.zip
You will also need Web3.js included in your pages.
- Add
'web3auth'
to theINSTALLED_APPS
setting - Set
'web3auth.backend.Web3Backend'
as your authentication backend:
AUTHENTICATION_BACKENDS = ['web3auth.backend.Web3Backend']
- Bind some URLs to
web3auth.views.login_view
andweb3auth.views.signup_view
. Both views take an optionaltemplate_name
argument.
from django.conf.urls import url
from web3auth import views as web3auth_views
urlpatterns = [
url(r'^login/$', web3auth_views.login_view, {'template_name' : 'login.html'}, name='login'),
url(r'^signup/$', web3auth_views.signup_view, name='signup'),
]
- Code your templates for login and signup pages. Example code can be found in login.html and signup.html