@login_requred decorator for authentication using mongoengine in django
I am new to mongoengine I wanted to use @login_required decorator for checking whether user is logged in or not.
I used following code :
'''
from django.contrib.auth.decorators import login_required
@login_required(login_url='/loginpage')
def index(request):

    return render_to_response('index.html')
'''

But above code is not working.Even though I submit correct username and passwrd it redirects to login page.
Anyone have any suggestions on how I can achieve my goal or know of any articles/examples that could help me along?

@login_requred decorator for authentication using mongoengine in django
===

I am new to mongoengine I wanted to use @login_required decorator for checking whether user is logged in or not.
I used following code :
'''
from django.contrib.auth.decorators import login_required
@login_required(login_url='/loginpage')
def index(request):

    return render_to_response('index.html')
'''

But above code is not working.Even though I submit correct username and passwrd it redirects to login page.
Anyone have any suggestions on how I can achieve my goal or know of any articles/examples that could help me along?
