Hi Igor,
If you use django <= 1.2 the you can replace 'render_to_response' with
'direct_to_template'. They do almost the same but 'direct_to_template'
uses RequestContext by default:
from django.views.generic.simple import direct_to_template
def my_view(request):
# ...
return
BTW, thank you very much.
I googled a lot, and decided that easiest way is replace all my "Context("
with "RequestContext(request," and use official way.
That works :)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
Ahh my bad. didn't see the last part of your post where you said you
had already tried the processor way :)
however the docs. mention thread safety concerns when it comes to
custom tags.
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#thread-safety-considerations
So perhabs it's
Yes, thank you Pete, but i know about this way. And it requires to use
RequestContext class on _every_ view.
I have too much of them, and also it makes boilerplate code. So, i'm
looking for less complicated way.
Maybe there is exist some way to use RequestContext by default?
--
You received
didn't mean to spam your thread… thought my answer was lost… :-S
On 26 Dec., 10:57, PeteDK wrote:
> Hi.
>
> You can use template context processors.
>
> http://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-c...
>
> you can either use the built in processors
Hi.
You can use template context processors.
http://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext
you can either use the built in processors or write your own. They
just have to be added in the settings file(all this is explained in
the docs)
These can
Hi.
You want to look at template context processors.
http://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext
You can create your own context processors or use the built in. These
can provide access to the current request in your template… and
therefore
Hi
I need to make an custom tag, for auth checks, based on data stored on
cookies. Like a:
{% if_loggen_in %}
Some message for logged in only user
{% end_if_logged_in %}
btw, i don't know how to get access to request object in my tag. I know that
there is 'inclusion tags', but as you see there
8 matches
Mail list logo