Message from discussion
include macro defs in simple template
Received: by 10.58.210.198 with SMTP id mw6mr768220vec.22.1352227312219;
Tue, 06 Nov 2012 10:41:52 -0800 (PST)
X-BeenThere: bottlepy@googlegroups.com
Received: by 10.220.155.207 with SMTP id t15ls842170vcw.8.gmail; Tue, 06 Nov
2012 10:41:51 -0800 (PST)
Received: by 10.58.15.10 with SMTP id t10mr775886vec.6.1352227311760;
Tue, 06 Nov 2012 10:41:51 -0800 (PST)
Received: by 10.58.15.10 with SMTP id t10mr775885vec.6.1352227311744;
Tue, 06 Nov 2012 10:41:51 -0800 (PST)
Return-Path: <bender.rodri...@gmail.com>
Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53])
by gmr-mx.google.com with ESMTPS id dj17si3480837vdb.1.2012.11.06.10.41.51
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 06 Nov 2012 10:41:51 -0800 (PST)
Received-SPF: pass (google.com: domain of bender.rodri...@gmail.com designates 209.85.212.53 as permitted sender) client-ip=209.85.212.53;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of bender.rodri...@gmail.com designates 209.85.212.53 as permitted sender) smtp.mail=bender.rodri...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-vb0-f53.google.com with SMTP id fc21so706367vbb.26
for <bottlepy@googlegroups.com>; Tue, 06 Nov 2012 10:41:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:sender:in-reply-to:references:date
:x-google-sender-auth:message-id:subject:from:to:content-type;
bh=0ehURJRtGv2SsEcJR8sV0+DkuIU7idqNrh7Sh+SS1FE=;
b=qxu/PoIK9RcnuBW9QW3bkjJ0338Tb07Y7i0+2UdZsGxVsCdqnCVZLFf1JCU1/6tiXH
A7QSn6a/s33mev9kY1sXK2jhKDEKdvaQ5UMKSmY3EhIw09uYwbZtZ4lL2/8EjV/HUKlh
KYIX708Sh3Uh3catxvIk1NPFME+fCVc+tYy88U408ljBch01XUxMB4UEY9dvLNbZKyUm
w8PNMTqSEOw7dOC2H02wLnA61VklDvx5waQScjICMOtmkoRusfWmBdTJ9B6DjrLEEosV
iw3PIi2wT6rSbx4vBn6gwpnZCGpNIHVvPMePokMKmJSNBx77qQ4GSG9LwIEscD8UkRHX
OKow==
MIME-Version: 1.0
Received: by 10.220.231.8 with SMTP id jo8mr1795071vcb.40.1352227311376; Tue,
06 Nov 2012 10:41:51 -0800 (PST)
Sender: bender.rodri...@gmail.com
Received: by 10.220.0.85 with HTTP; Tue, 6 Nov 2012 10:41:51 -0800 (PST)
Received: by 10.220.0.85 with HTTP; Tue, 6 Nov 2012 10:41:51 -0800 (PST)
In-Reply-To: <b17db6ac-d0dc-4a21-ab0d-0c73d0cdae59@googlegroups.com>
References: <b17db6ac-d0dc-4a21-ab0d-0c73d0cdae59@googlegroups.com>
Date: Tue, 6 Nov 2012 22:41:51 +0400
Message-ID: <CAGE_euxcAt9cb4iRf30pOyk_JyaA-vZq5UpXfjOagqJniAS...@mail.gmail.com>
Subject: Re: [bottlepy] include macro defs in simple template
From: bender <ben...@rodriges.org>
To: bottlepy@googlegroups.com
Content-Type: multipart/alternative; boundary=14dae9cdc0fd8cdae904cdd7f4b1
--14dae9cdc0fd8cdae904cdd7f4b1
Content-Type: text/plain; charset=ISO-8859-1
Have you tried %Defs.mymacro() ?
On Nov 6, 2012 10:06 PM, "Michael P" <michael.pris...@gmail.com> wrote:
> I would like to include a bunch of macro defs in a simple template but
> keep getting server error 500 if I try including the macro defs from a
> separate file. If I just paste the defs file into the beginning of the
> render template everything works fine. What am I doing wrong?
>
>
> Here are simplified versions of the base, render and defs templates. (I
> have tried a bunch of variants of the include statement eg %include Defs
> mymacro=mymacro and get the same outcome)
>
> Base.tpl:
>
> <!DOCTYPE html>
> <html lang="en">
> <head>
> <meta charset="utf-8">
> <title>{{Title}}</title>
> </head>
> <body>
> %include
> </body>
> </html>
>
> Render.tpl
>
> %rebase Base Title=Title
> %include Defs
> %mymacro()
> <div>
> Hello World
>
> Defs.tpl
>
> %def mymacro():
> <h1> Hello World <h2>
> %end
>
>
> --
> You are member of the "bottlepy" group at google groups.
> See http://groups.google.de/group/bottlepy for mailing list options.
> See http://bottlepy.org/ for news and documentation.
>
--14dae9cdc0fd8cdae904cdd7f4b1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<p>Have you tried %Defs.mymacro() ?</p>
<div class=3D"gmail_quote">On Nov 6, 2012 10:06 PM, "Michael P" &=
lt;<a href=3D"mailto:michael.pris...@gmail.com">michael.pris...@gmail.com</=
a>> wrote:<br type=3D"attribution"><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I would like to include a bunch of macro defs in a simple template but keep=
getting server error 500 if I try including the macro defs from a separate=
file.=A0 If I just paste the defs file into the beginning of the render te=
mplate everything works fine.=A0 What am I doing wrong?=A0 <br>
<br><br>Here are simplified versions of the base, render and defs templates=
. (I have tried a bunch of variants of the include statement eg=A0 %include=
Defs mymacro=3Dmymacro and get the same outcome)<br>
<br>Base.tpl:<br><br><!DOCTYPE html><br><html lang=3D"en"=
;><br><head><br><meta charset=3D"utf-8"><br><ti=
tle>{{Title}}</title><br></head><br><body><br>%include=
<br>
</body><br></html><br><br>Render.tpl<br><br>%rebase Base Title=
=3DTitle<br>%include Defs<br>%mymacro()<br><div><br>Hello World<br><b=
r>Defs.tpl<br><br>%def mymacro():<br><h1> Hello World <h2><br>
%end<br><br><br>
<p></p>
-- <br>
You are member of the "bottlepy" group at google groups.<br>
See <a href=3D"http://groups.google.de/group/bottlepy" target=3D"_blank">ht=
tp://groups.google.de/group/bottlepy</a> for mailing list options.<br>
See <a href=3D"http://bottlepy.org/" target=3D"_blank">http://bottlepy.org/=
</a> for news and documentation.<br>
</blockquote></div>
--14dae9cdc0fd8cdae904cdd7f4b1--