Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django's general setup() function

Tags:

django

I was reading the Django logging docs and came across this line:

Logging is configured as part of the general Django setup() function. Therefore, you can be certain that loggers are always ready for use in your project code.

Which general setup() function is being talked about here? Does this function execute only once at startup, making it the best entry point hook to add custom code?

How is it different from the MyAppConfig defined in apps.py.

like image 611
Darshan Chaudhary Avatar asked Oct 17 '25 19:10

Darshan Chaudhary


1 Answers

Its found in djangos __init__.py, it is the first thing that is called from get_wsgi_application

like image 153
Sayse Avatar answered Oct 20 '25 08:10

Sayse