1

Run a function in parellel in Django

This is my views.py

from django.shortcuts import render, redirect
from . import x
def index(request):
    return render(request,'a.html', {})

This is x.py

def y()
    while(True):
        print("X")
y()

Currently the while loop takes all resources and blocks Django from serving a.html I need to run Django and x.py simultaneously.They are unrelated.How should do I that?

I am stuck on this for 3 days.Plz help

Submitted February 13th 2021 by Admin

Answers
0

May be you want to checkout this https://docs.djangoproject.com/en/3.1/topics/async/

Admin | 8 months ago



Relevant Questions