On Thu, Jan 9, 2014 at 11:06 AM, luca72 <lucabe...@libero.it> wrote: > Hello > i have defined an url as: > > (r'^tipi/(\w)', 'polls.views.tipi'),
The word 'tipi', followed by a forward slash, followed by a SINGLE 'word' character, and then any other characters before the end of the URL (but none of them will be captured as an argument to your view, only the first word character.) > > the template is: > > (not relevant) > > the view is: > def tipi(request,a): > if a == 'Barbaresco': > testo = ['Wine name: BARBARESCO','Region: Piedmont'] > titolo = 'Wines' > variabile = 'vino' > return render_to_response('vini.html',{'testo':testo,'titolo':titolo, > 'testo':testo,'variabile':variabile,}) > > But i get that i don't have a http response where is the error? The view only returns a http response if a == 'Barbaresco', if it is any other value then your view returns nothing. A view must *always* return a HttpResponse, in every circumstance. Also, because of the URL issue I pointed out earlier, a will never equal 'Barbarseco'; at most it will be 'B'. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1LijkLw6Ef9U2%2BOp0zCAZHeaW_YLhiFHEeFHnVpCz2iFg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.