[BangPypers] Django Jquey List View issu

JAGANADH G jaganadhg at gmail.com
Tue Feb 19 08:00:30 CET 2013


On Mon, Feb 18, 2013 at 10:26 PM, anirudh bhat <abhat38 at gmail.com> wrote:

> Hello Jaganadh, your question is too abstract.Maybe you can show us some
> code u have written if you dont mind.There maybe lot of things that can go
> wrong here....one such example  is that maybe there is some problem with
> your Jquery code.Is page redirecting done right?? what does your django
> error log says??
>
>
>

Hi
This is the code which redirects the page

def user_login(request):
        cache.clear()
        request.session.flush()
        """
        Logging the user to the system
        """
        state = "Login  using your credentials"
        username,password = "",""
        if request.POST:
                username = request.POST.get('username')
                password = request.POST.get('password')

                user = authenticate(username= username,password=password)
                request.COOKIES['username'] = username
                if user is not None and user.is_authenticated():
                        if user.is_active:
                                login(request,user)
                                state = "Your login was successful !"
                                cookie_name = request.COOKIES['username']
                                #return
redirect('/index/',{'username':username},RequestContext(request,{'username':username}))
                                #return
HttpResponseRedirect('/index/',{'username':cookie_name})
                                #return
redirect('/index/',{'username':cookie_name})
                                #return
render_to_response('Index.html',{'username':cookie_name})
                                #return
redirect('/index/',{'username':cookie_name})
                                return
render_to_response('Index.html',{'username':cookie_name})
                else:
                        state = "Your credentials are incorrect !"
        return
render_to_response("Login.html",{'state':state,'username':username})


-- 
**********************************
JAGANADH G
http://jaganadhg.in
*ILUGCBE*
http://ilugcbe.org.in


More information about the BangPypers mailing list