Django Admin keeps redirecting to login page repeatedly

818 views
Skip to first unread message

Abdul Wahid

unread,
Feb 13, 2017, 5:07:09 PM2/13/17
to Django users
Hi Everyone,

Since last two nights, I am struggling a lot to resolve the issue as my Django admin section keeps redirecting to login page repeatedly.
I had tried every corner solution to resolve the issue, but failed to resolve it. 

Finally I am writing here in some hope that someone who already had the similar issue would help me to resolve it.

So I am using Django 1.9.4 and when I logged into admin section then its seems to be fine but when I reload the page or click on some button then it redirect me to login page, As per my investigation I found that I am getting 302 for "admin/jsi18n" see the below screenshot..


Below is the screenshot after reloading the above mentioned page..



I would really appreciate the help to resolve the issue and I need to move for production asap.


Thanks,

Abdul Wahid 


Tim Graham

unread,
Feb 13, 2017, 5:27:16 PM2/13/17
to Django users
Can you create a minimal project that reproduces the problem? It seems like something in the request/response cycle (middleware maybe?) is effectively logging you out on each request.

Abdul Wahid

unread,
Feb 13, 2017, 10:34:29 PM2/13/17
to Django users
Hey Tim,

Thanks for the hint, You are right the culprit was the "django_zappa.middleware.ZappaMiddleware"   Its working fine without this middleware but I require this middleware (Django Zappa) as for AWS lambda which provides me serverless hosting. 

Please let me know if you know something about this middleware.

Thanks,
Abdul Wahid

Tim Graham

unread,
Feb 14, 2017, 5:29:24 AM2/14/17
to Django users
No idea but it seems like you should update your requirements per that project's readme: "Please note that django-zappa has been superceded by Zappa, which includes all of the django-zappa features and more!"

Even the latest version of django-zappa doesn't have a middleware anymore.
https://github.com/Miserlou/django-zappa/commit/424143cdfe4057184e22eab5f6134b01b8685728

Abdul Wahid

unread,
Feb 14, 2017, 7:15:38 AM2/14/17
to django...@googlegroups.com
Yes, I removed that middleware and its working fine now. I would always keep an eye these third party tools before blaming to django core. 
Thanks for the advice.

Regards,
Abdul Wahid

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/F9XCiLDbkbY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4c62e75b-0d5e-4327-9d93-d3d79dcad3c9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages