how to start a thread when django runserver?

2024/10/11 18:23:48

I want to start a thread when django project runserver successfully. where can I put the create-thread-and-start code? Is there any hook for the django runserver?

Answer

Why would you want to do that? runserver is for development only, it should never be used in production. And if you're running via Apache, it should manage threads/processes for you anyway.

https://en.xdnf.cn/q/118294.html

Related Q&A

pandas groupby plot values

I have a pandas dataframe that looks like this:**real I SI weights**0 1 3 0.3 0 2 4 0.20 1 3 0.50 1 5 0.51 2 5 0.3…

Any python module for customized BNF parser?

friends.I have a make-like style file needed to be parsed. The grammar is something like:samtools=/path/to/samtools picard=/path/to/picardtask1: des: descriptionpath: /path/to/task1para: [$global.samto…

How to draw an histogram with multiple categories in python

I am a freshman in python, and I have a problem of how to draw a histogram in python.First of all, I have ten intervals that are divided evenly according to the length of flowers petal, from min to max…

Turtle in Tkinter creating multiple windows

I am attempting to create a quick turtle display using Tkinter, but some odd things are happening.First two turtle windows are being created, (one blank, one with the turtles), secondly, any attempt of…

Array tkinter Entry to Label

Hey Guys I am beginner and working on Project Linear and Binary search GUI application using Tkinter, I want to add multiple Entry boxes values to label and in an array here, I tried but its not workin…

Grid search and cross validation SVM

i am implementing svm using best parameter of grid search on 10fold cross validation and i need to understand prediction results why are different i got two accuracy results testing on training set not…

Accessing dynamically created tkinter widgets

I am trying to make a GUI where the quantity of tkinter entries is decided by the user.My Code:from tkinter import*root = Tk()def createEntries(quantity):for num in range(quantity):usrInput = Entry(roo…

Graphene-Django Filenaming Conventions

Im rebuilding a former Django REST API project as a GraphQL one. I now have queries & mutations working properly.Most of my learning came from looking at existing Graphene-Django & Graphene-Py…

Summing up CSV power plant data by technology and plant name

Ive got a question regarding the Form 860 data about US power plants.It is organized block-wise and not plant-wise. To become useful, the capacity numbers must be summed up.How may I get the total capa…

Send and receive signals from another class pyqt

I am needing a way to receive signals sent by a Class to another class. I have 2 classes: In my first class I have a function that emits a signal called asignal In my second class I call the first cla…