Friday, August 24, 2012

Context Help

I'm at the end of  my rope lol.

For the life of me i cant discern where you put Context definitions.
Ive had a look at django tutorial and the documentation and unless im seriously overlooking something i cant find the information i need.
I understand perfectly how it works.

E.g:  P = Context()
P['Name'] = "Fred"
P["Age"] = "27"

<html>
<head>
</head>
<body>
Hi my name is {{ P.Name }}
</body>
</html>

I can understand that perfectly. What i cant understand is where do place the P = Context() P['Name'] = "Fred".
Does it go in the models file, Views file, html file, seperate file??

Im basically tearing my hair out in frustration as im sure its really simple but i just cant see it.

If someone could someone please give an example or explain where i need to place it i would be extremely gratefull!!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/DGYplcAezacJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate