how to made a "admin-only" for in html page (not view.py),has this method :user.is_superuser ??
- by zjm1126
in views.py:
@user_passes_test(lambda u: u.is_superuser)
def h_view(request):
return render_to_response('mytest/news.html',context_instance=RequestContext(request))
but i want to show this page when admin login,and my now page is :
<li id="tab_mytest"><a href="{% url mytest_list %}" class="{% block mytest_css_name %}{% endblock %}">{% trans "mytest" %}</a></li>
how to change it,
has this method :user.is_superuser ??
thanks