John McCollum

Disable CSRF protection for Django 1.2

One of the major changes to Django 1.2 was the automatic switching-on of CSRF protection. I ran into some problems today, hitting the following error.

Forbidden (403)
CSRF verification failed. Request aborted.

Read More…

Posted in Django, web development at July 5th, 2010. 4 Comments.

Book Review: Django 1.1 Testing and Debugging

A wealth of tools are available to debug and test Django applications, but knowing when and how to use these resources can intimidate the new user. Django 1.1 Testing and Debugging, by Karen M. Tracey, aims to walk the user through the process of creating a web application from scratch, ensuring that the resulting code is bug-free and ready for production.In a way, Django makes it deceptively easy to write a dynamic web application. With a few lines of code, you can have an fully functional application up and running in a short space of time, and complex applications take less time than ever to develop. Inevitably, though, bugs will creep in to the development process, and the professional developer will want to make sure that their application is as bug-free as possible before launching.

The book opens with a simple question: “How do you know when code you have written is working as intended?” The answer, of course, is that you test it. But if you’re not a cowboy coder, you’ll want to leverage the full power of Django’s automated testing framework for best results. In the course of this book, the author develops a full web application, from start to finish, and describes how each section would be tested and debugged. Read More…

Posted in Django, Python at June 3rd, 2010. No Comments.

Twitter Reddit Flickr LinkedIn Stack Overflow Github Email Ne RSS