Hello
I have created app for public view or well.. the whole site actually,
but its somehow not working.
I have this in views.py
def index(request):
lpl = lang.objects.filter(id=1)
t = loader.get_template('front/index.html')
c = Context({
'lpl': lpl
})
return HttpResponse(t.render(c))
And this in index.html :
{% if lpl %}
<html>
<head><title>{{ lpl.title }}</title></head>
<body>
<h1>{{ lpl.name }}</h1>
</body>
</html>
{% else %}
<h1>crap</h1>
{% endif %}
For a while i was getting crap, until i copy pasted code from
example... now im getting just this in browser:
<html>
<head><title></title></head>
<body>
<h1></h1>
</body>
</html>
So obviously i dont know how to use the data from the model and
perhaps im phrasing the question both wrong here and in my searches,
because i have not been able to find answer in groups or web.
Alan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---