Roh Codeur
2015-04-08 19:25:18 UTC
Hi
I have a django app which has certain sections which are reserved for
registered users. I have the views annotated with login_required decorator
which redirects the user to a login page.
However, I would like to keep the user on the same page and open up a modal
dialog prompting user to sign in(like on the website:
http://www.fashiolista.com/). To achieve this, I thought I could setup a
middleware(instead of using login_required) and return a response like
below:
return HttpResponse("<script>"
"showLogin()"
"</script>")
When I try to do this, I realised that this renders a page with only the
script tag, which obviously doesnt work.
I am using Bootstrap for showing modal dialogs.
Middleware link:
http://onecreativeblog.com/post/59051248/django-login-required-middleware
Any ideas?
I have a django app which has certain sections which are reserved for
registered users. I have the views annotated with login_required decorator
which redirects the user to a login page.
However, I would like to keep the user on the same page and open up a modal
dialog prompting user to sign in(like on the website:
http://www.fashiolista.com/). To achieve this, I thought I could setup a
middleware(instead of using login_required) and return a response like
below:
return HttpResponse("<script>"
"showLogin()"
"</script>")
When I try to do this, I realised that this renders a page with only the
script tag, which obviously doesnt work.
I am using Bootstrap for showing modal dialogs.
Middleware link:
http://onecreativeblog.com/post/59051248/django-login-required-middleware
Any ideas?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1fa57021-7f12-466e-902f-52fd6b4e78c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1fa57021-7f12-466e-902f-52fd6b4e78c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.