Wednesday, August 1, 2012

Re: Detecting browser type after login

On Wed, Aug 1, 2012 at 1:36 PM, Kurtis Mullins <kurtis.mullins@gmail.com> wrote:
> 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.

Yes, the dialog will be generated with javascript. My initial approach
was to do this all on the client side, but I was not able to figure
out how to fit that into the app (which was my original question).

Here's how it's structured:

Login screen is generated with django template
User clicks on submit
django login() is called, then a function from our views is called
that returns HttpResponseRedirect.

They want the dialog to pop up on top of the login screen before the
redirect. I don't know where the code that does this would live or how
it would get invoked.

As far as to why they want this, it doesn't really support IE, and
they want to alert the user to that if that's what they're using. It's
a custom app, not for public use.


>
> 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.

--
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