I have come across this issue, where I want to return something and call another function afterwards (in python)
heres my current code:
def new_user(request):
'''Takes a request and enters it in the database IF that wallet id is not in the database! '''
data = request.body
if data != '':
user_info = eval(data)
if type(user_info) != type({}):
... more code here ...
send_email(vCode)
return HttpResponse(response)
I want to call send_email after returning a response. I have tried a few things here: -calling both new_user and send_email in another function but I need to return some sort of HttpResponse (so I can't call new_user without returning it...) so this does not work - tried to yield a request, cannot call another function after yield -tried threading, had a similar issue -Currently trying asyncio but i'm running into issues with that aswell, is there anything else I can do?
send_emailjust before returning)?