Planet Venus & multiple Django templates
Amit Chakradeo (अमित चक्रदेव)
chakradeo+planet at gmail.com
Sat Mar 13 15:07:00 EST 2010
Yes, catching and ignoring the exception will work. Here is a patch I sent a
few days ago against failing tests:
--Amit
=== modified file 'planet/shell/dj.py'
--- planet/shell/dj.py 2007-07-07 22:53:41 +0000
+++ planet/shell/dj.py 2010-02-16 18:03:41 +0000
@@ -19,6 +19,7 @@
# I need to re-import the settings at every call because I have to
# set the TEMPLATE_DIRS variable programmatically
from django.conf import settings
+ settings._wrapped=None
try:
settings.configure(
DEBUG=True, TEMPLATE_DEBUG=True,
On Thu, Mar 11, 2010 at 10:23 PM, Justin Dugger <jldugger at ubuntu.com> wrote:
> It seems I've run into a bug in planet venus, when using Django to
> output both HTML and RSS.
>
> With the following theme config.ini:
> [Planet]
> template_files:
> rss20.xml.dj
> index.html.dj
>
> I get:
> $ planet /etc/planet/planet.ini
> Traceback (most recent call last):
> File "/usr/bin/planet", line 138, in <module>
> splice.apply(doc.toxml('utf-8'))
> File "/usr/lib/pymodules/python2.6/planet/splice.py", line 118, in apply
> output_file = shell.run(template_file, doc)
> File "/usr/lib/pymodules/python2.6/planet/shell/__init__.py", line 66, in
> run
> module.run(template_resolved, doc, output_file, options)
> File "/usr/lib/pymodules/python2.6/planet/shell/dj.py", line 25, in run
> TEMPLATE_DIRS=(os.path.dirname(script),)
> File "/usr/lib/pymodules/python2.6/django/conf/__init__.py", line
> 49, in configure
> raise RuntimeError, 'Settings already configured.
>
> Each template works fine on its own, but when both are supplied it
> fails. As a workaround I think I can just invoke planet twice with
> seperate config files, but perhaps it's as easy as catching the
> runtime error and continuing?
>
> Justin Dugger
> --
> devel mailing list
> devel at lists.planetplanet.org
> http://lists.planetplanet.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </archives/devel/attachments/20100312/c2d43cb5/attachment.html>
More information about the devel
mailing list