django-web3-auth is a pluggable Django app that enables login/# 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.#_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'^#/$', web3auth_views.#_view, name='#'),
]
- Code your templates for login and # pages. Example code can be found in login.html and #.html