Wednesday, August 1, 2012

Re: Detecting browser type after login

Is the "Dialog Box" going to be presented using Javascript? If so, why not use Javascript for this functionality? I'd typically only use this type of functionality to serve pages when javascript isn't enabled or you need to show various templates based upon the type of browser (for example, a Mobile browser). Just a suggestion.

On Wed, Aug 1, 2012 at 3:11 PM, Larry Martell <larry.martell@gmail.com> wrote:
On Tue, Jul 31, 2012 at 8:05 PM, Larry Martell <larry.martell@gmail.com> wrote:
> I've only been working with django for 6 months, and I'm not really
> clear on how the login process works.
>
> I have a client that has a login screen created by a template. It has
> a submit button with:
>
> <form id="login" action="/accounts/login/" method="POST">
>
> In their urls file they have:
>
> (r'^accounts/login/$', login)
>
> In their views file they call login(request)
>
> What they want is, after the user has successfully logged in, I need
> to detect which browser they are using, and depending on which it is,
> potentially pop up a dialog box. I can't figure out where that code
> would live. I'm not asking how to detect the browser type, but rather,
> where that javascript code would go, and how I would cause it to get
> invoked after the login.

Someone suggested getting the browser type on the server side, and
then adding a variable to my response and check it in the template. I
like this solution, however I cannot figure out how to add the
variable to the response. After the successful login, the code calls
HttpResponseRedirect. How can I can I add a variable to that?

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment