Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 14, 2011 16:44:12

Fletcher H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Template behaving oddly...


Hi everyone,

I'm trying to work on a project in Django, but I'm encountering some odd
behavior. I have this in base.html in my template directory:

<html>
<head>
<link rel="stylesheet" href="{{ STATIC_URL }}style.css" />
<title>{% block title %}Schedule{% endblock %}</title>
</head>
<body>
<div id="logobar">
{% block logobar %}
Logo bar will go here
{% endblock %}
</div>
<div id="menubar">
{% block menubar %}
Menu will go here
{% endblock %}
</div>
<div id="content">
{% block content %}{% endblock %}
</div>
</body>
</html>

And my test view is this:

def test(request):
t = loader.get_template('base.html')
return HttpResponse(t)

and this is what results on a webpage:

'> ]> '>]> '>]> '>

with the view source of the page looking like this:

<Text Node: '<html> <head> '><Variable Node: STATIC_URL><Text Node:
'style.css" /> <t'><Block Node: title. Contents: ><Text Node: '</title> </head> '><Block Node: logobar. Contents:
><Text Node: ' </div> '><Block Node: menubar.
Contents: ><Text Node: ' </div> '><Block Node:
content. Contents: ><Text Node: ' </div> </b'>

I'm really confused at this point...I would appreciate any help.

Thanks!

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 14, 2011 18:29:30

Rubén D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Template behaving oddly...


You get the template but you don't render it.

2011/1/14 Fletcher Haynes <kuroskni...@gmail.com>

> Hi everyone,
>
> I'm trying to work on a project in Django, but I'm encountering some odd
> behavior. I have this in base.html in my template directory:
>
> <html>
> <head>
> <link rel="stylesheet" href="{{ STATIC_URL }}style.css" />
> <title>{% block title %}Schedule{% endblock %}</title>
> </head>
> <body>
> <div id="logobar">
> {% block logobar %}
> Logo bar will go here
> {% endblock %}
> </div>
> <div id="menubar">
> {% block menubar %}
> Menu will go here
> {% endblock %}
> </div>
> <div id="content">
> {% block content %}{% endblock %}
> </div>
> </body>
> </html>
>
> And my test view is this:
>
> def test(request):
> t = loader.get_template('base.html')
> return HttpResponse(t)
>
> and this is what results on a webpage:
>
> '> ]> '>]> '>]> '>
>
> with the view source of the page looking like this:
>
> <Text Node: '<html> <head> '><Variable Node: STATIC_URL><Text Node:
> 'style.css" /> <t'><Block Node: title. Contents: ><Text Node: '</title> </head> '><Block Node: logobar.
> Contents: ><Text Node: ' </div> '><Block
> Node: menubar. Contents: ><Text Node: ' </div>
> '><Block Node: content. Contents: ><Text Node: ' </div> </b'>
>
> I'm really confused at this point...I would appreciate any help.
>
> Thanks!
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Jan. 17, 2011 03:15:39

Fletcher H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Template behaving oddly...


Ah, got it. Thanks so much!

2011/1/14 Rubén Dugo Martín <rdugomar...@gmail.com>

> You get the template but you don't render it.
>
> 2011/1/14 Fletcher Haynes <kuroskni...@gmail.com>
>
>> Hi everyone,
>>
>> I'm trying to work on a project in Django, but I'm encountering some odd
>> behavior. I have this in base.html in my template directory:
>>
>> <html>
>> <head>
>> <link rel="stylesheet" href="{{ STATIC_URL }}style.css" />
>> <title>{% block title %}Schedule{% endblock %}</title>
>> </head>
>> <body>
>> <div id="logobar">
>> {% block logobar %}
>> Logo bar will go here
>> {% endblock %}
>> </div>
>> <div id="menubar">
>> {% block menubar %}
>> Menu will go here
>> {% endblock %}
>> </div>
>> <div id="content">
>> {% block content %}{% endblock %}
>> </div>
>> </body>
>> </html>
>>
>> And my test view is this:
>>
>> def test(request):
>> t = loader.get_template('base.html')
>> return HttpResponse(t)
>>
>> and this is what results on a webpage:
>>
>> '> ]> '>]> '>]> '>
>>
>> with the view source of the page looking like this:
>>
>> <Text Node: '<html> <head> '><Variable Node: STATIC_URL><Text Node:
>> 'style.css" /> <t'><Block Node: title. Contents: ><Text Node: '</title> </head> '><Block Node: logobar.
>> Contents: ><Text Node: ' </div> '><Block
>> Node: menubar. Contents: ><Text Node: ' </
>> div> '><Block Node: content. Contents: ><Text Node: ' </div> </b'>
>>
>> I'm really confused at this point...I would appreciate any help.
>>
>> Thanks!
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>>http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 11th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support