1 2 3 4 5 | def dynamic_import( path ):
l = path.rfind('.')
parent, child = path[:l], path[l+1:]
base = __import__(parent, globals(), globals(), [child])
return getattr(base, child, None)
|
More like this
- Dynamic import from an installed app by Archatas 3 years, 1 month ago
- Template tag to create mailto links with options by celopes 2 years, 11 months ago
- module_from_path by simon 4 years ago
- Dynamic Template Loader by jgeewax 3 years, 10 months ago
- Django model cron jobs by willhardy 3 years, 7 months ago
Comments
Looks great for plugins!
#