I have a function in my Django Views.py and I use the data in another function but if a user changes True to False then I want to update it without having to restart Django.
def update_list():
global processess
processess = botactive.objects.filter(active=True).values_list('user')
update_list()
I use processess which fetches users who have a model field set to True but if they set it to False I want to not include them if there is a new request.
listi = [row[0] for row in processess]
def wallet_verify(listi):
# print(listi)
database = Bybitapidatas.objects.filter(user = listi)
...
This is the request I make and want it to use fresh data without restarting Django and also in python and not using html.
def verifyt(request):
with ProcessPoolExecutor(max_workers=4, initializer=django.setup) as executor:
results = executor.map(wallet_verify, listi)
return HttpResponse("done")