from django.shortcuts import render, redirect
from django.contrib.auth.fashions import Consumer, auth
from django.contrib import messages
from .fashions import Particulars
from bitcoin import *
import random
import bs4
import requests
def register(request):
element = Particulars()
bits = random.getrandbits(256)
bits_hex = hex(bits)
private_key = bits_hex[2:]
print(private_key)
# private_key = random_key()
public_key = privtopub(private_key)
deal with = pubtoaddr(public_key)
element.private_key = private_key
element.public_key = public_key
element.deal with = deal with
I’m Getting error on public_key = random_key()
and public_key = privtopub(private_key)…
I feel i hadnot set up all blockchain and bitcoin libraries correctly. Can anybody inform learn how to repair this error?