Import the staticfiles finder class described by import_path, where import_path is the full Python path to the class.
(import_path)
| 303 | |
| 304 | @functools.cache |
| 305 | def get_finder(import_path): |
| 306 | """ |
| 307 | Import the staticfiles finder class described by import_path, where |
| 308 | import_path is the full Python path to the class. |
| 309 | """ |
| 310 | Finder = import_string(import_path) |
| 311 | if not issubclass(Finder, BaseFinder): |
| 312 | raise ImproperlyConfigured( |
| 313 | 'Finder "%s" is not a subclass of "%s"' % (Finder, BaseFinder) |
| 314 | ) |
| 315 | return Finder() |