[Answer]-Django (1.6) Login status success or not?

1👍

You can include this in your <head>:

<script>var logged_in={{ request.user.is_authenticated|lower }};</script>

If you want information on the user that you can use in multiple usecases you can add this to urls.py:

urlpatterns += patterns('', url(r'^loggedinuser/$'),
            lambda r:'{"is_logged_in":"%s"}'%r.user.is_authenticated)

You can of course expand upon this, add other features you want revealed.

Leave a comment