setting.py:
LOGIN_REDIRECT_URL = 'index_login'
LOGIN_URL = 'login'
urls.py:
url(r'^login$',auth_views.LoginView.as_view(redirect_authenticated_user=True),name='login'), url(r'^index_login', views.index_login, name='index_login')
view.py:
@login_required
def index_login(request):
# this view is created solely for the purpose of being able to log the login information through logToDb
ut.logToDb(database, messages=['Successful login.'], user=request.user)
ut.log_info('Successful login by ' + str(request.user) + '.')
context = {'user': request.user}
return render(request, 'mainapp/index.html', context)
index.html:
{% extends 'mainapp/base.html' %} {% load static %} {% block content %} <h3>Databases</h3> <br/><br/> <div class="fluid-container"> <div class="col-md-4"> <a class="btn btn-primary btn-block btn-vspace" type="button" href="plc/index">Inventory</a> </div> </div> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>{% endblock %}
I am facing this problem only if Django logout automatically. But if I logout and login then I am not having issue so It is really tricky for me to generate the exact scenario
Regards
Isha
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2392d64f-0110-4fe2-a5ec-5af27c561a6ao%40googlegroups.com.