[PATCH] Move TIME_ZONE and LANGUAGE_CODE hints to settings_local.py.template to

2 views
Skip to first unread message

Ben Jackson

unread,
Dec 1, 2009, 12:52:40 AM12/1/09
to byteflow-hackers
# HG changeset patch
# User Ben Jackson <b...@ben.com>
# Date 1259646658 28800
# Node ID 4a38ed4b891bda8ab4359e53758d8f00a477b8d4
# Parent 10f5ab8a7f3098bd8aedcfce396818ed4d3653c8
Move TIME_ZONE and LANGUAGE_CODE hints to settings_local.py.template to
encourage setting proper values. Change default timezone to GMT; keep
Kiev as hint in .template.

diff -r 10f5ab8a7f30 -r 4a38ed4b891b settings.py
--- a/settings.py Fri Nov 27 22:44:12 2009 -0800
+++ b/settings.py Mon Nov 30 21:50:58 2009 -0800
@@ -29,13 +29,8 @@

MANAGERS = ADMINS

-# Local time zone for this installation. All choices can be found here:
-# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
-TIME_ZONE = 'Europe/Kiev'
-
-# Language code for this installation. All choices can be found here:
-# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
-# http://blogs.law.harvard.edu/tech/stories/storyReader$15
+# Defaults -- set these in settings_local.py
+TIME_ZONE = 'GMT'
LANGUAGE_CODE = 'en-us'

SITE_ID = SiteIDHook()
diff -r 10f5ab8a7f30 -r 4a38ed4b891b settings_local.py.template
--- a/settings_local.py.template Fri Nov 27 22:44:12 2009 -0800
+++ b/settings_local.py.template Mon Nov 30 21:50:58 2009 -0800
@@ -5,6 +5,15 @@
DATABASE_USER = ''
DATABASE_PASSWORD = ''

+# Local time zone for this installation. All choices can be found here:
+# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
+#TIME_ZONE = 'Europe/Kiev'
+
+# Language code for this installation. All choices can be found here:
+# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
+# http://blogs.law.harvard.edu/tech/stories/storyReader$15
+#LANGUAGE_CODE = 'en-us'
+
TAGLINE = u'Everyone will like it'
FOOTER = u'(c) 2007-2009 <a href="/about/">Alexander Solovyov</a>'

Alexander Solovyov

unread,
Dec 1, 2009, 3:52:12 AM12/1/09
to byteflow...@googlegroups.com
On Tue, Dec 1, 2009 at 7:52 AM, Ben Jackson <b...@ben.com> wrote:
>
> # HG changeset patch
> # User Ben Jackson <b...@ben.com>
> # Date 1259646658 28800
> # Node ID 4a38ed4b891bda8ab4359e53758d8f00a477b8d4
> # Parent  10f5ab8a7f3098bd8aedcfce396818ed4d3653c8
> Move TIME_ZONE and LANGUAGE_CODE hints to settings_local.py.template to
> encourage setting proper values.  Change default timezone to GMT; keep
> Kiev as hint in .template.

Can you please make first line of message to be subject of patch and then put
longer description after an empty line? Like it's done in "fbbcb1062844".

And while I think this is good patch, I'd like to discuss one possibility about
changing configuration system.

Currently we have settings_local.py imported from settings.py, which I thought
is enough to have proper support for user configuration. But now I think that it
would be good if we will switch to settings_common.py and settings.py.template
(with settings*.py ignored). This way single copy of Byteflow code would be
enough to host as many blogs with different databases as settings as desired.

Any thoughts on this? Any ideas how we can do this smoothly

--
Alexander

Ben Jackson

unread,
Dec 1, 2009, 1:57:42 PM12/1/09
to byteflow...@googlegroups.com
On Tue, Dec 01, 2009 at 10:52:12AM +0200, Alexander Solovyov wrote:
>
> On Tue, Dec 1, 2009 at 7:52 AM, Ben Jackson <b...@ben.com> wrote:
> >
> > # HG changeset patch
> > # User Ben Jackson <b...@ben.com>
> > # Date 1259646658 28800
> > # Node ID 4a38ed4b891bda8ab4359e53758d8f00a477b8d4
> > # Parent  10f5ab8a7f3098bd8aedcfce396818ed4d3653c8
> > Move TIME_ZONE and LANGUAGE_CODE hints to settings_local.py.template to
> > encourage setting proper values.  Change default timezone to GMT; keep
> > Kiev as hint in .template.
>
> Can you please make first line of message to be subject of patch and then put
> longer description after an empty line? Like it's done in "fbbcb1062844".

I don't see that rev, but I know what you're talking about. I thought
I was being clever there by making the first line a summary and then
continuing to describe the change.

Are you requesting that I modify the patch and resubmit? Or is that a
request for the future?

> Any thoughts on this? Any ideas how we can do this smoothly

I am not a Django expert at all -- I'm really using byteflow as a
learning project. However, one thing you could do to tidy up the
settings is to move them to a directory, where the glue logic could
go in settings/__init__.py which could pull in settings/common.py and
settings/local.py. That would allow you to use different filenames
but still retain the python namespace settings.FOO.

--
Ben Jackson AD7GD
<b...@ben.com>
http://www.ben.com/

Alexander Solovyov

unread,
Dec 2, 2009, 4:28:35 AM12/2/09
to byteflow...@googlegroups.com
On 2009-12-01, Ben Jackson wrote:

> Are you requesting that I modify the patch and resubmit? Or is that a
> request for the future?

First one (resubmitting patch), please. :-)

>> Any thoughts on this? Any ideas how we can do this smoothly

> go in settings/__init__.py which could pull in settings/common.py and


> settings/local.py. That would allow you to use different filenames
> but still retain the python namespace settings.FOO.

Hmm... no, I'm not sure I like this idea. Idea is that you can easily
put byteflow code and settings in different locations, while making
module like settings/__init__.py locks us down.

--
Alexander

Reply all
Reply to author
Forward
0 new messages