Jason Giedymin  committed 1e94469

- Modified to import the names file set in
- Proposal for 'GENERATED_MEDIA_MAP_FILE' to be obtained (getattr) 'from django.conf.settings'.
A large split Django project may have the need for generating unique map files per
site/settings file.

  • Participants
  • Parent commits fe65e71

Comments (0)

Files changed (1)

File mediagenerator/

 import re
-    from _generated_media_names import NAMES
+    MEDIA_MAP_MODULE = os.path.splitext(os.path.basename(GENERATED_MEDIA_MAP_FILE))[0]
+    NAMES = __import__(MEDIA_MAP_MODULE, ['NAMES']).NAMES
 except ImportError:
     NAMES = None
 def get_production_mapping():
     if NAMES is None:
-        raise ImportError('Could not import _generated_media_names. This '
+        raise ImportError('Could not import map file "%s". This '
                           'file is needed for production mode. Please '
-                          'run generatemedia to create it.')
+                          'run generatemedia to create it.' \
+                          % MEDIA_MAP_MODULE)
     return NAMES
 def get_media_mapping():