Many thanks to all!

Adding the django.core.context_processors.request solves the problem.

For memory:

In settings.py:

    TEMPLATE_CONTEXT_PROCESSORS = (
       "django.core.context_processors.auth",
       "django.core.context_processors.debug",
       "django.core.context_processors.i18n",
       "django.core.context_processors.media",
       "django.core.context_processors.request",
    )

In urls.py

        (r'^$', 'zsite.ancore.views.indice'),

In views.py:

    def indice(request):
       xxx=request.user.get_and_delete_messages()
       return render_to_response("ancore/index.html",
                         { 'title' : 'ANCORE','messages' : xxx},
                         context_instance=RequestContext(request))

In index.html:

        {{ request.path|dovesono }}

Again thanks to all
    Mirto


Daniel Roseman ha scritto:
> On Oct 15, 9:29 am, Mirto Silvio Busico <[EMAIL PROTECTED]> wrote:
>   
>> bruno desthuilliers ha scritto:> On 15 oct, 09:40, Mirto Silvio Busico 
>> <[EMAIL PROTECTED]> wrote:
>>
>>     
>>>> Well, a little step ahead: the filter receives an empty string.
>>>>         
>>>> In the template the line:
>>>>     {{ request.path|dovesono }}
>>>>         
>>>> passes to the "dovesono" filter a string with length 0.
>>>>         
>>> And what do you get *without* the filter ? Are you sure you have a
>>> valid request object in your context ?
>>>       
>> You are right: without the field I see that I don't have any request.path.
>>
>> How can I know if I receive a valid request? If I put an error in the
>> filter I see the error page showing a request.
>>
>> Mybe I'm loosing something essential with the template system.
>>
>> Any suggestion on what I have to study?
>>
>> Thanks
>>     Mirto
>>     
>
>
> All page views are valid requests. I think it's simpler than that: you
> just aren't passing the 'request' variable to the view.
>
> You either have to do it explictly in your context, or if you're using
> render_to_response call you should add
> context_instance=RequestContext(request)
> as the third parameter. If you do this, you'll also need to enable
> django.core.context_processors.request in your
> TEMPLATE_CONTEXT_PROCESSORS setting.
>
> See here:
> http://docs.djangoproject.com/en/dev/ref/templates/api/#id1
> --
> DR.
> >
>
>   


-- 

_________________________________________________________________________
Busico Mirto Silvio
Consulente ICT
cell. 333 4562651
email [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to