This is not via Python, but you can also check the cetaf_api column in the django_migrations SQL table. EG.
SELECT * FROM public.django_migrations;
Rows usually contain the name of the app, along with modules such as sessions, contenttypes and auth