[PATCH] Default THEME_STATIC_ROOT, THEME_STATIC_URL after settings_local sets THEME

4 views
Skip to first unread message

Ben Jackson

unread,
Nov 23, 2009, 5:06:02 PM11/23/09
to byteflow-hackers
# HG changeset patch
# User b...@ben.com
# Date 1259013349 28800
# Node ID 0c4b31a206bd9d657460f47fc579aef2894ebcf5
# Parent 9134403990881695edddb7271db85c26cc2ddcd0
Default THEME_STATIC_ROOT, THEME_STATIC_URL after settings_local sets THEME

Changeset e92edb071fbe moved these settings above settings_local, but
this forces the user to set them in settings_local or they will contain
the 'default' theme path rather than the THEME-specific path. Move them
back down to pick up local THEME, but don't override them if local set them.

diff -r 913440399088 -r 0c4b31a206bd settings.py
--- a/settings.py Mon Nov 16 12:47:42 2009 +0200
+++ b/settings.py Mon Nov 23 13:55:49 2009 -0800
@@ -233,8 +233,6 @@
SOCIAL_BOOKMARKS = ('delicious', 'reddit', 'slashdot', 'digg', 'technorati', 'google')

LOCALE_PATHS = (os.path.join(PROJECT_ROOT, 'locale'), )
-THEME_STATIC_ROOT = STATIC_ROOT # So this can be overridden
-THEME_STATIC_URL = os.path.join(STATIC_URL, THEME + '/')
THEMES_DIR = os.path.join(PROJECT_ROOT, "themes") # Byteflow themes. Your themes can be out of PROJECT_ROOT.
TEMPLATE_DEBUG = DEBUG

@@ -247,6 +245,12 @@
DEBUG = False
ADDITIONAL_APPS = ('pingback', 'watchlist')

+if not hasattr(globals(), 'THEME_STATIC_ROOT'):
+ THEME_STATIC_ROOT = STATIC_ROOT
+
+if not hasattr(globals(), 'THEME_STATIC_URL'):
+ THEME_STATIC_URL = os.path.join(STATIC_URL, THEME + '/')
+
try:
INSTALLED_APPS += ADDITIONAL_APPS
except NameError:

Alexander Solovyov

unread,
Nov 25, 2009, 3:25:09 PM11/25/09
to byteflow...@googlegroups.com
On Tue, Nov 24, 2009 at 12:06 AM, Ben Jackson <b...@ben.com> wrote:
>
> # HG changeset patch
> # User b...@ben.com
> # Date 1259013349 28800
> # Node ID 0c4b31a206bd9d657460f47fc579aef2894ebcf5
> # Parent  9134403990881695edddb7271db85c26cc2ddcd0
> Default THEME_STATIC_ROOT, THEME_STATIC_URL after settings_local sets THEME

Thanks, applied and pushed. :-)

--
Alexander

Reply all
Reply to author
Forward
0 new messages