9/04/2011
I look a bit painful to do this at first, but here is a very simple solution.
- Install brew
- run ‘brew instal PIL’
- Brew install PIL at /usr/local/Cellar/pil/1.1.7/lib/python2.6/site-packages
- Symlink the PIL site-packages to your Python site-packages in /Library/Python/2.6/site-packages
ln -s /usr/local/Cellar/pil/1.1.7/lib/python2.6/site-packages/PIL /Library/Python/2.6/site-packages/PIL
17/02/2010
Are you updating an old Django project to use Django 1.2, and getting this error message when you try to login to the Django admin page?
403 Forbidden
CSRF verification failed. Request aborted.
Help
Reason given for failure:
CSRF cookie not set.
Then you need to add ‘django.middleware.csrf.CsrfViewMiddleware’, and ‘django.middleware.csrf.CsrfResponseMiddleware’ your settings.py file. Mine looks like this:
MIDDLEWARE_CLASSES = (
‘django.middleware.common.CommonMiddleware’,
‘django.contrib.sessions.middleware.SessionMiddleware’,
‘django.contrib.auth.middleware.AuthenticationMiddleware’,
‘django.middleware.csrf.CsrfViewMiddleware’,
‘django.middleware.csrf.CsrfResponseMiddleware’,
)
Thanks to the Django docs http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-to-use-it