I have tried to call the signout url from template then redirect to home page.

profile.html:

```
<li><a data-hover="Logout" href="{% url 'signout' %}">Logout</a></li>

```

urls.py:

```
urlpatterns = [
    url(r'^$', views.login, name='login'),
    url(r'^ajax/validate_username/$', views.validate_username, name='validate_username'),
    url(r'^signout$', views.signout, name='signout'),
]

```

views.py:

```
def signout(request):
    if request.user.is_authenticated():
        logout(request)
        return HttpResponsePermanentRedirect('/')
    else:
        return HttpResponsePermanentRedirect('/')

```

Sometimes signout functionality is not working, while clicking the logout menu(The function signout is calling).