aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2012-07-06 17:35:01 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2012-07-14 12:55:14 -0500
commit9a422c1fd0ece59bd38900777d31abf6e11126fa (patch)
treeab9cf5bc43da565723f290fd51dd8eb094d8d65d
parent5377114c4d1a3e5a9f80c49f27af81470a30230c (diff)
downloadmediagoblin-9a422c1fd0ece59bd38900777d31abf6e11126fa.tar.lz
mediagoblin-9a422c1fd0ece59bd38900777d31abf6e11126fa.tar.xz
mediagoblin-9a422c1fd0ece59bd38900777d31abf6e11126fa.zip
Add the theme domain to the application's staticdirector
-rw-r--r--mediagoblin/config_spec.ini1
-rw-r--r--mediagoblin/init/__init__.py12
2 files changed, 9 insertions, 4 deletions
diff --git a/mediagoblin/config_spec.ini b/mediagoblin/config_spec.ini
index 7fc5fa70..03243e0b 100644
--- a/mediagoblin/config_spec.ini
+++ b/mediagoblin/config_spec.ini
@@ -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()
diff --git a/mediagoblin/init/__init__.py b/mediagoblin/init/__init__.py
index e9708398..f7bef421 100644
--- a/mediagoblin/init/__init__.py
+++ b/mediagoblin/init/__init__.py
@@ -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():