Skip to main content

No project description provided

Project description

**Documentation**

Django is a great web application framework “for perfectionists with deadlines”.

A dApp is an app running on the blockchain: a smart contract on which users can call functions on.

This module provides blockchain support for Django, for reading and/or writing the blockchain, with the following features usable independently:

  • blockchain indexer

  • private key vault

  • blockchain writer

  • blockchain data normalization

  • multiple blockchain support (tezos & ethereum so far)

  • inter-blockchain contract synchronisation

  • metamask authentication backend (TBA)

In addition to these features, djWebdApp differenciates itself from indexers like dipdup because it is extensible: it’s just a module you add to your Django project like any other Django App, in which you can add models, endpoints, and have an admin interface for free, and so on, benefiting from the vast Django ecosystem of apps.

Video demos

Getting started

Django basics

If you are not familiar with the Django development framework, it is recommended you follow their tutorial first, even though you can go through this tutorial copy/pasting your way.

You may use the demo project or create your own and install djwebdapp there.

Install

To install djwebdapp with all optional dependencies:

pip install djwebdapp[all][binary]

Don’t use [binary] right there if you prefer to install compiled python packages from your system package manager.

See setup.py’s extra_requires for other possibilities.

Demo project

For this tutorial, we’ll use the djwebdapp_demo project:

git clone https://yourlabs.io/oss/djwebdapp.git
cd djwebdapp
pip install --editable .[all][binary]
./manage.py migrate
./manage.py shell

Local blockchains

Instead of using mainnets for development, we’re going to use a local blockchains, so that we can work completely locally.

We provide a docker-compose.yml in the root directory of this repository, run docker-compose up to start it.

As some of us will also want to convert this to GitLab-CI services, we’ll refer to our services by hostname from now on, which is why we add the following to /etc/hosts:

127.0.0.1 tzlocal ethlocal

You should then have:

  • a local ethereum HTTP RPC API on ethlocal:8545 with a WebSocket on ethlocal:30303,

  • a local tezos sandbox on tzlocal:8732 which autobakes every second, useable like geth development mode.

See documentation for Example contract deployment in each blockchain specific documentation pages for more pointers.

Custom project

Instead of the demo project, you can also create your own project, instead of the first step of cloning do:

  • run django-admin startproject your_project_name

  • in your_project_name/your_project_name/settings.py, add to INSTALLED_APPS: 'djwebdapp', 'djwebdapp_tezos', 'djwebdapp_ethereum'… See djwebdapp_demo/settings.py for other INSTALLED_APPS you can use

  • proceed with the next steps migrate`, ``createsuperuser, runserver

Tutorial

Read documentation online or in the docs/ directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djwebdapp-0.4.19rc1.tar.gz (29.3 kB view details)

Uploaded Source

File details

Details for the file djwebdapp-0.4.19rc1.tar.gz.

File metadata

  • Download URL: djwebdapp-0.4.19rc1.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

File hashes

Hashes for djwebdapp-0.4.19rc1.tar.gz
Algorithm Hash digest
SHA256 281a5fc0174d28b477694d0de48ca0c6a30a981f85774db366463cb8d8d6ea24
MD5 e836586d27ad5c34b643a890c412efec
BLAKE2b-256 2911ae7ec63b93934685d44d4d04acdb8d2a9afe991df5bb72ef4e6ea84e3aa3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page