custom_import Module

This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <>

Support for smart import syntax for web2py applications

exception gluon.custom_import.CustomImportException[source]

Bases: exceptions.ImportError

class gluon.custom_import.TrackImporter[source]

Bases: object

An importer tracking the date of the module files and reloading them when they are changed.

THREAD_LOCAL = <thread._local object>
gluon.custom_import.custom_importer(name, globals=None, locals=None, fromlist=None, level=-1)[source]

web2py’s custom importer. It behaves like the standard Python importer but it tries to transform import statements as something like “import applications.app_name.modules.x”. If the import fails, it falls back on naive_importer