On Apr 15, 9:32 am, Gil Sousa <gilso...@gmail.com> wrote: > Hi! > > I have one menu that I use as a "base" template, this menu has some > entries which some of them should be restricted to logged users, but > even when I loggin I cannot see those entries. > > This is my menu.html: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <meta http-equiv="content-type" content="text/html; charset=utf-8" /> > <title>{% block title %}{% endblock %}</title> > <meta name="keywords" content="" /> > <meta name="description" content="" /> > <link rel="stylesheet" type="text/css" href="/site_media/css/ > style.css" media="screen" /> > </head> > <body> > <div id="header"> > <h1>Header</h1> > </div> > <div id="menu"> > <ul> > <li><a href="/">Home</a></li> > {% if user.is_authenticated %} > <li><a href="/accounts/profile/">Profile</a></li> > <li><a href="/forum/">Community</a></li> > {% endif %} > <li><a href="#">Menu 3</a></li> > <li><a href="#">Menu 4</a></li> > <li><a href="#">Menu 5</a></li> > </ul> > </div> > {% block content %}{% endblock %} > </body> > </html> > > What should I change?
Are you sure you are passing a 'user' variable into the template? This only happens automatically if you are using the 'auth' context processor, and are using a RequestContext instance instead of Context to render your template. -- DR. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---