Add the theme domain to the application's staticdirector
authorChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 6 Jul 2012 22:35:01 +0000 (17:35 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 14 Jul 2012 17:55:14 +0000 (12:55 -0500)
mediagoblin/config_spec.ini
mediagoblin/init/__init__.py

index 7fc5fa708d20bed9b5f196f999089793c6d6b280..03243e0b0f0f6ff48032e8ed0857c4762205aa86 100644 (file)
@@ -62,6 +62,7 @@ geolocation_map_visible = boolean(default=False)
 
 # Theming stuff
 theme_install_dir = string(default="%(here)s/user_dev/themes/")
+theme_web_path = string(default="/theme_static/")
 theme = string()
 
 
index e9708398d2e541122e585160a5c15fb542aa07dc..f7bef4212f8fc39084a08760d23ef68e9e3b415e 100644 (file)
@@ -102,13 +102,17 @@ def get_jinja_loader(user_template_path=None, current_theme=None):
 
 
 def get_staticdirector(app_config):
-    if not 'direct_remote_path' in app_config:
+    # At minimum, we need the direct_remote_path
+    if not 'direct_remote_path' in app_config \
+            or not 'theme_web_path' in app_config:
         raise ImproperlyConfigured(
-            "One of direct_remote_path or "
-            "direct_remote_paths must be provided")
+            "direct_remote_path and theme_web_path must be provided")
+
+    direct_domains = {None: app_config['direct_remote_path'].strip()}
+    direct_domains['theme'] = app_config['theme_web_path'].strip()
 
     return staticdirect.StaticDirect(
-        {None: app_config['direct_remote_path'].strip()})
+        direct_domains)
 
 
 def setup_storage():