Django/IE8 Admin Interface Weirdness - django

Esteemed Django experts and users:
I have been using Django's admin interface for some data editing needs. I am using it on Windows Server 2008, and using django-mssql to connect to a SQL Server backend. Python 2.6.2 Django 1.1.0 final 0
As per usual w/ Django, this was fairly easy to set up, and works beautifully on Firefox, but using IE8 I intermittently get a puzzling 'Internet Explorer cannot display this webpage' when I save a record.
In the log, looks like typically on a save there's a POST request that returns a 302 status followed by a GET returning a lovely 200. This is on Firefox. On IE8 looks like sometimes POST works but GET doesn't.
So that's what I have going on. Any help w/ this will be appreciated. Thank you.

I suspect the bug is within IE8's refusal to process the redirect properly.
The 302 POST pushes to browser to the 200 GET, but if the browser never processes the 302 then the Django (or the server) will not log a 200 GET because the browser never opened the page (the server can only log what is accessed, ergo the browser is not making the call).
If you have Django behind something (IIS using FastCGI, or Apache, or something), bump up the logs to make sure there's no silent error in rendering. I had the same problem on Vista x64 Ultimate IE8 Beta 2, but compatibility mode appeared to fix the problem somewhat -- there was still some intermittently occurring refusal to redirect.

I realize this post is a bit old now, but I had the exact same symptoms recently. After a lot of digging around, I found that IE8 has issues accepting cookies with a life of less than 20 minutes.
In our Django project's settings.py we had the property SESSION_COOKIE_AGE set to 10 minutes. Once I bumped it to 20 minutes, IE8 had no problems logging in.

Related

Prerender.io first hit missed

I installed prerender.io with Nginx on my Ember.js project.I use the Facebook debugger to check if the prerender is installed correctly. The problem:
Each first hit of the prerender is a fail. Unfortunately, Facebook caches this version, so it is the one that is displayed on the site.
When I ask "Fetch new scrape informations", I get a hit and the content is displayed properly.
How can I make the first try a hit?
GUESSES
Maybe there is a problem with window.prerenderReady, that is used in my project (ember-prerender)?
Maybe the Nginx configuration does not wait for the result of the caching, or the caching is too long?
INFOS
I use Nginx with the standard configuration recommended by prerender.io
Facebook can timeout if the response takes longer than 5 seconds. It sounds like your pages are taking 5+ seconds to render when being rendered on the fly. The reason it works the second time is because the page is cached at that point and returned in < 100ms.
I'd suggest trying to speed up your page loading time so that pages rendered on the fly are returned more quickly. Send and email to support#prerender.io if you want some help there! We can send you the timings of requests being made on your URLs.

Django authentication works on Chrome, but not on Firefox

I'm having a problem where Django's login is working okay on Chrome but not on Firefox: when trying to login to a restricted portion of the site on Firefox, it simply loops back again and again to the login page; furthermore, no error message appears on the log regarding that.
Interestingly, the error doesn't happen when the server is on the local machine.
Does someone have a general idea of what could be causing that strange behavior?
I'm using Django 1.6 on Python 2.7
this isn't much of an answer, but a linking to other similar problems. Because I don't have rep, all I can do is leave an answer.
A issue like this was encountered in 2012 but was never conclusively answered:
Django session doesn't work in Firefox
A similar question where the user could login via local server but not remote firefox was encoutered:
Unable log in to the django admin page with a valid username and password
The second was very well documented and had an accepted answer that was well liked.
Recommendations:
If you are not using https make sure you have this setting SESSION_COOKIE_SECURE = False.
If you are using a database backed, Check if the session is actually being created in the django_sessions table .
If you are using a cached backed, check that SESSION_ENGINE is django.contrib.sessions.backends.cache and that CACHE_BACKEND is properly configured.

disabling or refusing to accept cookies in moodle

I'm having trouble working with moodle. I've installed it successfully. After I filled the installation form
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.", the second pic. I tried again but it says the same thing for 2 days now. I've tried removing cookies, but still doesn't work.
There is an easy way.
In the file
\moodle\admin\index.php
search and commandout
//redirect("index.php?sessionstarted=1&lang=$CFG->lang");
This trick worked for me.

310 Redirect loop error in chrome due to Machii Redirect event

I am getting a 310: Too many redirects error in Chrome when I run my website. However this is not the case for IE or Firefox.
I am using Mach-ii framework and this is the case where I am using redirect in an event-handler.
e.g:
<event-handler event="A">
<announce event="B">
<announce event="C">
</event-handler>
<event-handler event="C">
<redirect event="D">
</event-handler>
<event-handler event="D">
<view-page name="foo">
</event-handler>
So, if I get to this page, it renders perfectly. But if I hit browser back and then next button again, I get the error.
Some common solutions to this kind of error from Chrome could be
Delete all the site's cookies and restart your browser.
Synchronize your computers time. In the date and time settings for your computer, sync it to a time server.
I've also heard of different update channels having the issue and others not. As in the Beta channel for Chrome would not have this issue, but the Stable version does have the issue. I've heard of things like plugins (chrome scripts) being a problem. I suppose as a last solution remove Chrome completely and install it from fresh.
I personally dont think its a Mach-ii or Coldfusion issue. Hope you come right.

dev server hiccups after saving from in Django admin

This is starting bug me: whenever I use the django admin to add or edit a record, I hit save and expect a confirmation page, but the result is a page that tells me the website is experiencing an error (it's not a Django page with a traceback, just a default view in my browser). If I hit reload or back in the browser, it takes me back to the user form. Even though the confimation page doesn't display, it never fails to save my entry in the database, so it's apparently just a problem generating/serving the confirmation page.
Has anyone else had this problem? Am I missing something obvious?
My server: Django dev server
My browser: Internet Explorer 7 (but same problem occurs with any broswer I use)
My OS: Windows XP
I got such a behaiviour when I overwrote __init__ incorrectly. Or to be more precise when switching to a new version of Django with these worng __init__s. That was the day I started to love signals :D.
Can you post your models?
This is certainly not how it's supposed to work! Have you been messing around in the Django codebase at all? The first thing that comes to mind here is a "pdb.set_trace()" left by mistake somewhere in the change_list codepath. Off-hand I can't think what else would cause the server to simply not respond.