[Solved]-What does admin.autodiscover actually do?

5👍

As u said: autodiscover() load all admin.py from the apps folders. So you have in the /admin/ all the models that you use (from your own app or not).

I recommend to use autodiscover() if you are going to use the admin app.

P.D. additionally some app have their on autodiscover with more functionalities.

2👍

admin.py is executed whenever your django loads URLconf from urls.py, the autodiscover() will search for all the apps in INSTALLED_APPS one by one and executes the code in that file.

👤Kota

Leave a comment