def autodiscover():
from importlib import import_module<EOL>from django.apps import apps<EOL>from django.utils.module_loading import module_has_submodule<EOL>for app_config in apps.get_app_configs():<EOL><INDENT>try:<EOL><INDENT>before_import_sizedimage_registry = copy.copy(<EOL>versatileimagefield_registry._sizedimage_registry<EOL>)<EOL>before_import_filter_registry = copy.copy(<EOL>versatileimagefield_registry._filter_registry<EOL>)<EOL>import_module('<STR_LIT>' % app_config.name)<EOL><DEDENT>except Exception:<EOL><INDENT>versatileimagefield_registry._sizedimage_registry =before_import_sizedimage_registry<EOL>versatileimagefield_registry._filter_registry =before_import_filter_registry<EOL>if module_has_submodule(app_config.module, '<STR_LIT>'):<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>
Discover versatileimagefield.py modules.

Iterate over django.apps.get_app_configs() and discover
versatileimagefield.py modules.