call the method router.get_migratable_models with argument: app_config, connection.alias and include_auto_created set to True, substitute the result for app_models.
app_models = router . get_migratable_models ( app_config , connection . alias , include_auto_created = True )