Hello all

I experienced a strange behaviour with my django application when I
wanted to deploy and test on my apache instance on my virtual server.
I could successfully deploy my application but when I wanted to access
any view the browser just took forever to load and it never showed the
view. Accessing any non existing view gave the correct debug error
view.

After a long debugging session I could locate the problem to be in
django/middleware/csrf.py. The call which actually took a very long
time was the call to randrange(0, _MAX_CSRF_KEY).

By playing around in a python session it seems that the call to the
system randrange with random.SystemRandom().randrange(0,
_MAX_CSRF_KEY) never stops (or doesn't seem to stop in less than 30
minutes) whereas a call to the "normal" randrange with randrange(0,
_MAX_CSRF_KEY) happily returns the desired random number.

I had to manully set the line "randrange = random.randrange" instead
of the if/else logic which checks for the system random generator to
make my app work on my virtual host.

Now it seems that is not a django problem per se. But I am wondering
what I should to with this kind of error as I had to manually fiddle
around in the django-code to be able to successfully host my
application.

In my virtual host I use apache 2.2.15 with python 2.6.5, mod_wsgi 3.2
and django 1.2.1

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to