Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » Comments » comment category for "Comments (sct)" » You also need this if adding comments to your models

When adding comments for your own model you also need to pass the Http 'request' object into your template. So in your view.py you will have:

view.py

def myfunction(request):
    # stuff
    return render_to_response('mytemplate.html', {'request': request})


I hope that helps someone, it took me a while to figure out.

Steve

--- Last Edited by Steve at 2009-09-25 02:35:58 ---
i would generally advice to always use RequestContext. this will automatically put the request object into the context as well as handle the TEMPLATE_CONTEXT_PROCESSORS.
Hey, we have Signatures !!! Great, isn't it ? ;)
Thanks Herbert, I didn't know about RequestContexts. I still have a lot to learn about Django.

And hanks for Sphene! Especially the board/comments feature. It is exactly what I'm looking for.

Best Regards,
Steve

Please login to post a reply.



Powered by Sphene Community Tools