2019-09-24 19:02:54 +02:00
|
|
|
=============================
|
|
|
|
Django-Cryptolock
|
|
|
|
=============================
|
|
|
|
|
|
|
|
.. image:: https://badge.fury.io/py/django-cryptolock.svg
|
|
|
|
:target: https://badge.fury.io/py/django-cryptolock
|
|
|
|
|
|
|
|
.. image:: https://travis-ci.org/dethos/django-cryptolock.svg?branch=master
|
|
|
|
:target: https://travis-ci.org/dethos/django-cryptolock
|
|
|
|
|
2019-09-24 19:49:30 +02:00
|
|
|
.. image:: https://coveralls.io/repos/github/dethos/django-cryptolock/badge.svg
|
|
|
|
:target: https://coveralls.io/github/dethos/django-cryptolock
|
2019-09-24 19:02:54 +02:00
|
|
|
|
2020-02-19 16:04:19 +01:00
|
|
|
Django authentication using cryptocurrency wallets.
|
|
|
|
|
|
|
|
**DISCLAIMER:** This package is still in an early stage of development. It isn't meant to be
|
|
|
|
used on any production scenario yet (in other words, only test projects for now).
|
2019-09-24 19:02:54 +02:00
|
|
|
|
|
|
|
Documentation
|
|
|
|
-------------
|
|
|
|
|
|
|
|
The full documentation is at https://django-cryptolock.readthedocs.io.
|
|
|
|
|
|
|
|
Quickstart
|
|
|
|
----------
|
|
|
|
|
|
|
|
Install Django-Cryptolock::
|
|
|
|
|
|
|
|
pip install django-cryptolock
|
|
|
|
|
|
|
|
Add it to your `INSTALLED_APPS`:
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
INSTALLED_APPS = (
|
|
|
|
...
|
|
|
|
'django_cryptolock.apps.DjangoCryptolockConfig',
|
|
|
|
...
|
|
|
|
)
|
|
|
|
|
2019-12-01 01:07:03 +01:00
|
|
|
Migrate your database.
|
|
|
|
|
2019-09-24 19:02:54 +02:00
|
|
|
Add Django-Cryptolock's URL patterns:
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
2019-12-01 01:07:03 +01:00
|
|
|
from django.conf.urls import url
|
2019-09-24 19:02:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
...
|
2019-12-01 01:07:03 +01:00
|
|
|
url(r"^auth/", include("django_cryptolock.urls", namespace="django_cryptolock")),
|
2019-09-24 19:02:54 +02:00
|
|
|
...
|
|
|
|
]
|
|
|
|
|
2020-01-06 13:23:41 +01:00
|
|
|
|
2019-12-01 01:07:03 +01:00
|
|
|
Add the following settings to your project:
|
|
|
|
|
2020-01-06 13:23:41 +01:00
|
|
|
* ``django_cryptolock.backends.MoneroAddressBackend`` to your
|
|
|
|
``AUTHENTICATION_BACKENDS``
|
|
|
|
* Set ``DJCL_MONERO_NETWORK`` with the network in use: ``mainnet``,
|
|
|
|
``stagenet`` or ``testnet``
|
|
|
|
* Use ``DJCL_MONERO_WALLET_RPC_PROTOCOL``, ``DJCL_MONERO_WALLET_RPC_HOST``,
|
|
|
|
``DJCL_MONERO_WALLET_RPC_USER`` and ``DJCL_MONERO_WALLET_RPC_PASS`` to specify
|
|
|
|
which wallet RPC should be used.
|
2019-12-01 01:07:03 +01:00
|
|
|
|
2020-01-06 13:23:41 +01:00
|
|
|
Finaly create the templates files (``login.html`` and ``signup.html``) under a
|
|
|
|
``django_cryptolock`` subfolder.
|
2019-12-01 01:07:03 +01:00
|
|
|
|
2019-09-24 19:02:54 +02:00
|
|
|
Features
|
|
|
|
--------
|
|
|
|
|
2020-01-06 13:23:41 +01:00
|
|
|
* Adds authentication based on cryptocurrency wallets to a Django project.
|
2019-09-24 19:02:54 +02:00
|
|
|
|
|
|
|
Running Tests
|
|
|
|
-------------
|
|
|
|
|
|
|
|
Does the code actually work?
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
source <YOURVIRTUALENV>/bin/activate
|
|
|
|
(myenv) $ pip install tox
|
2019-10-14 14:13:54 +02:00
|
|
|
(myenv) $ tox -e <your-python-version>-django-22
|
2019-09-24 19:02:54 +02:00
|
|
|
|
|
|
|
Credits
|
|
|
|
-------
|
|
|
|
|
|
|
|
Tools used in rendering this package:
|
|
|
|
|
|
|
|
* Cookiecutter_
|
|
|
|
* `cookiecutter-djangopackage`_
|
|
|
|
|
|
|
|
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
|
|
|
|
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage
|