def autodiscover():
import imp<EOL>from django.conf import settings<EOL>for app in settings.INSTALLED_APPS:<EOL><INDENT>try:<EOL><INDENT>app_path = __import__(app, {}, {}, [app.split('<STR_LIT:.>')[-<NUM_LIT:1>]]).__path__<EOL><DEDENT>except AttributeError:<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>imp.find_module('<STR_LIT>', app_path)<EOL><DEDENT>except ImportError:<EOL><INDENT>continue<EOL><DEDENT>__import__("<STR_LIT>" % app)<EOL><DEDENT>
Automatically build the provider index.