Asinox
unread,Jul 23, 2009, 11:27:18 AM7/23/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi guys, im trying to use the login and logout functions of Django,
but my @login_required() dont work, dont redirecto to the login form
and show the view where the user need to be logged...
VIEW
from django.shortcuts import render_to_response, get_object_or_404,
Http404
from django.contrib.auth.decorators import login_required
from diligencia.diligencias.models import UserProfile, Diligencia
@login_required()
def index(request):
entradas = Diligencia.objects.all()
return render_to_response('account/listar_deligencias.html',
{'listar': entradas})
SETTINGS
LOGIN_REDIRECT_URL = '/accounts/profile/'
LOGIN_URL = '/accounts/login/'
What's wrong?
Thanks