Git Product home page Git Product logo

ujblockchain / sarchiweb Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 18.32 MB

Official Website for South Africa-Switzerland Bilateral Research Chair in Blockchain Technology (UJ Blockchain) which aims to explore blockchain integrations with real-world applications and development.

Home Page: https://blockchain.uj.ac.za

License: Other

Python 24.38% CSS 22.92% JavaScript 9.43% SCSS 0.39% HTML 42.88%
agri-food blockchain blockchain-technology dapps-development web3 web3-dapp django jinja2 hedera hedera-hashgraph

sarchiweb's Introduction

image info

SARCHI

South Africa-Switzerland Bilateral Research Chair in Blockchain Technology (UJ Blockchain) aims to explore blockchain integrations with real-world applications and development in Agric food.

Setup

Set environment variable for Django Secret Key, Debug, Allowed Host, and Admin Path. Also add configuration for Database, Django Axes and Email with SMTP Host.

SECRET_KEY = '...'
DEBUG = ..
ALLOWED_HOSTS = '...'
ADMIN_PATH = '..'

ENGINE = '...'
NAME = '...'
HOST = '...'
USER = '...'
PASSWORD = '...'
PORT = ...

SILENCED_SYSTEM_CHECKS = '...'
AXES_FAILURE_LIMIT = '...'
AXES_COOLOFF_TIME = '...'
AXES_ONLY_ADMIN_SITE = '...'
AXES_LOCKOUT_TEMPLATE = '...'
AXES_LOCKOUT_URL = '...'
AXES_USERNAME_FORM_FIELD = '...'
AXES_RESET_ON_SUCCESS = '...'
AXES_NEVER_LOCKOUT_WHITELIST = '...'
AXES_IP_WHITELIST = '...'
AXES_ENABLE_ACCESS_FAILURE_LOG = '...'
AXES_RESET_ON_SUCCESS = '...'
AXES_LOCKOUT_PARAMETERS = '...'

EMAIL_BACKEND = ''...'
EMAIL_PORT = '...'
EMAIL_HOST = '...'
EMAIL_HOST_USER = '...'
EMAIL_HOST_PASSWORD = '...'
DEFAULT_FROM_EMAIL = '...'
SERVER_EMAIL = '...'
EMAIL_SUBJECT_PREFIX = '...'
EMAIL_USE_TSL = '...'

Recaptcha Setup

Set google recaptcha public and private key in environment variables. Public and private key can be gotten from https://developers.google.com/recaptcha/. Ensure you use reCAPTCHA v3.

RECAPTCHA_PUBLIC_KEY = '...'
RECAPTCHA_PRIVATE_KEY = '...'
RECAPTCHA_REQUIRED_SCORE = ...

Huey Setup

Setup huey distributed task processing using 'greenlet' worker type. For greenlet to work, you need to setup a monkey patch that serves as a custom bootstrap script.

HUEY = {
    'huey_class': 'huey.RedisHuey',  # Huey implementation to use.
    'name': config('NAME'),  # Use db name for huey.
    'results': True,  # Store return values of tasks.
    'store_none': False,  # If a task returns None, do not save to results.
    'immediate': False,
    'utc': True,  # Use UTC for all times internally.
    'blocking': True,  # Perform blocking pop rather than poll Redis.
    'connection': {
        'host': 'localhost',
        'port': 6379,
        'db': 0,
        'connection_pool': None,  # Definitely you should use pooling!
        # ... tons of other options, see redis-py for details.

        # huey-specific connection parameters.
        'read_timeout': 1,  # If not polling (blocking pop), use timeout.
        'url': None,  # Allow Redis config via a DSN.
    },
    'consumer': {
        'workers': 1,
        'worker_type': 'thread',
        'initial_delay': 0.1,  # Smallest polling interval, same as -d.
        'backoff': 1.15,  # Exponential backoff using this rate, -b.
        'max_delay': 10.0,  # Max possible polling interval, -m.
        'scheduler_interval': 1,  # Check schedule every second, -s.
        'periodic': True,  # Enable crontab feature.
        'check_worker_health': True,  # Enable worker health checks.
        'health_check_interval': 1,  # Check worker health every second.
    },
}

Running Project

Install Dependencies

$ pip install -r requirements.txt

Make Migrations

$ python manage.py makemigrations
$ python manage.py migrate

create Superuser

$ python manage.py createsuperuser

Run Server

$ python manage.py runserver

Start Background Task

There is need for a background task using huey to send emails to users.

$ python manage.py run_huey

Running Test With Coverage

$ coverage run manage.py test

Coverage Report

$ coverage report
$ coverage html

sarchiweb's People

Contributors

edmundrotimi avatar ujblockchain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.