On Jan 2, 2016, at 8:11 AM, Matthew <mbd1925@gmail.com> wrote:Actually it turned out this works!! My TextEdit app was being finnicky and made me re-write the entire code instead of just the quotation marks. Thanks for the help!
On Saturday, January 2, 2016 at 10:52:22 AM UTC-5, Matthew wrote:Hi James,I turned smart quotes off and am still having the error. I wasn't aware that could cause future errors though, so thanks for the heads up!
On Saturday, January 2, 2016 at 12:44:22 AM UTC-5, James Schneider wrote:
On Jan 1, 2016 8:08 PM, "Matthew" <mbd...@gmail.com> wrote:
>
> Hi all,
>
> I'm working through the masteringdjango book, and am struggling in the Templates area.
>
> I created a base.html base template, and am attempting to include a child template.
>
> This is the child template:
>
> {% extends "base.html" %}
>
> {% block title %}The current time{% endblock %}
>
> {% block content %}
> <p>It is now {{ current_date }}.</p>
> {% endblock %}
>
> When I run the site, I get the following error message:
> Could not parse the remainder: '"base.html"' from '"base.html"'
>
> And it points to the first line of the child template.
>
> I don't understand what I am doing wrong, please help.Was this template code primarily copied/pasted from an example?
Can you try deleting and manually typing new quotes around the base.html reference in your {% extends %} tag?
Not sure if it's my email client or not, but those appear to be "smart quotes", which lean left/right, usually automatically inserted by editor applications like MS Word or possible from a translation from text to PDF to make things "pretty".
To a computer parser like the Django template system, those are interpreted differently as regular characters rather than quotes, which would explain the parser error you are receiving. Hard to spot, but I've been bit by that type of subtle bug before.
-James
Saturday, January 2, 2016
Re: Could not parse the remainder template inheritance
If you're just getting your feet wet and don't want to invest in an editor/IDE just yet, try TextWrangler: http://www.barebones.com/products/textwrangler/ It's free and won't get in your way.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment