views:

332

answers:

2

Hi guys, i dont know what mean this error, the erro comming when im try to enter to the admin

..webapps/django/lib/python2.5/django/db/backends/mysql/base.py:84: Warning: Truncated incorrect DOUBLE value: 'AnonymousUser'

and another error is :

"403 Forbidden Cross Site Request Forgery detected. Request aborted."

somebody know about it?

Thanks

A: 

Django provides a "mock" user called AnonymousUser. My guess would be you are trying to use the AnonymousUser as a foreign key to another model which will not work. There is a check user.is_anonymous() that you can do and handle the case were there is not an authenticated user.

You need to add for context if you want help with your second error. A surefire fix is to comment out the CSRF middleware.

Jason Christa
A surefire fix for a parachute chafing you is to take off the parachute. Doesn't mean it's a good idea.
Dominic Rodger
Like I said he gave no context. Was he using the test server or running through unit tests?
Jason Christa
hi guys, thanks, i know why the first error.. now, the second about CSFR i dont know how ill fix, im using live site, and i would like th use the CSRF for more security, but i got this error...
Asinox
A: 

I beleive its due to the increase security in Django 1.2.1. You need to lower the security of your application to make it work with the above version and go back to the old security quality. Have a look at the related doc on the main djangoproject.com side

In your INSTALLED_APPS section you add the following to do so:

'django.middleware.csrf.CsrfResponseMiddleware',
PeterR