Django 1.1 Testing and Debugging and over 1.5 million other books are available for Amazon Kindle . Learn more


or
Sign in to turn on 1-Click ordering.
Trade in Yours
For a £2.80 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Colour:
Image not available

 
Start reading Django 1.1 Testing and Debugging on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Django 1.1 Testing and Debugging [Paperback]

Karen M. Tracey
4.3 out of 5 stars  See all reviews (3 customer reviews)
RRP: £30.99
Price: £29.44 & this item Delivered FREE in the UK with Super Saver Delivery. See details and conditions
You Save: £1.55 (5%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In stock.
Dispatched from and sold by Amazon. Gift-wrap available.
Want delivery by Wednesday, 22 May? Choose Express delivery at checkout. See Details

Formats

Amazon Price New from Used from
Kindle Edition £19.56  
Paperback £29.44  
Amazon.co.uk Trade-In Store
Did you know you can trade in your old books for an Amazon.co.uk Gift Card to spend on the things you want? Visit the Books Trade-In Store for more details. Learn more.

Book Description

20 April 2010 1847197566 978-1847197566
Bugs are a time consuming burden during software development. Django's built-in test framework and debugging support help lessen this burden. This book will teach you quick and efficient techniques for using Django and Python tools to eradicate bugs and ensure your Django application works correctly.

This book will walk you step by step through development of a complete sample Django application. You will learn how best to test and debug models, views, URL configuration, templates, and template tags. This book will help you integrate with and make use of the rich external environment of test and debugging tools for Python and Django applications.

The book starts with a basic overview of testing. It will highlight areas to look out for while testing. You will learn about different kinds of tests available, and the pros and cons of each, and also details of test extensions provided by Django that simplify the task of testing Django applications. You will see an illustration of how external tools that provide even more sophisticated testing features can be integrated into Django's framework.

On the debugging front, the book illustrates how to interpret the extensive debugging information provided by Django's debug error pages, and how to utilize logging and other external tools to learn what code is doing.

Frequently Bought Together

Django 1.1 Testing and Debugging + Django JavaScript Integration: AJAX and jQuery + The Definitive Guide To Django: Web Development Done Right 2nd Edition (Expert's Voice in Web Development)
Price For All Three: £83.71

Buy the selected items together


Product details

  • Paperback: 416 pages
  • Publisher: Packt Publishing (20 April 2010)
  • Language: English
  • ISBN-10: 1847197566
  • ISBN-13: 978-1847197566
  • Product Dimensions: 19.1 x 2.2 x 23.5 cm
  • Average Customer Review: 4.3 out of 5 stars  See all reviews (3 customer reviews)
  • Amazon Bestsellers Rank: 345,618 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, and more.

Product Description

About the Author

Karen M. Tracey


Karen has a PhD in Electrical/Computer Engineering from the University of Notre Dame. Her research there focused on distributed operating systems, which led to work in industry centered on communications protocols and middleware. Outside of work she has an interest in puzzles, which led her to take up crossword construction. She has published nearly 100 puzzles in The New York Times, The Los Angeles Times syndicate, The New York Sun, and USA Today. She amassed a database of thousands of puzzles to aid in constructing and cluing her own puzzles. The desire to put a web frontend on this database is what led her to Django. She was impressed by the framework and its community, and became an active core framework contributor. Karen is one of the most prolific posters on the Django users mailing list. Her experience in helping hundreds of people there guided her in choosing the best and most useful material to include in this book.


Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:


Customer Reviews

3 star
0
2 star
0
1 star
0
4.3 out of 5 stars
4.3 out of 5 stars
Most Helpful Customer Reviews
By Paolo C
Format:Paperback
Disclaimer: I received a review copy of this book from the publisher, Packt Publishing.

I am using Django almost at full time since 0.96 (it was 2007, March when it was tagged), so from about 3 years now, and I have read almost every book has been out from Apress.
This is the first book I read from Packt about Django (I have read one about Plone, one about Joomla and one about jQuery), and I may say that I am impressed from their way to package valuable and very specific contents in a single book.
If many times it is easy to get specified contents on the web, in this case, for the topics covered by this book, this is not so obvious and anyway it is very nice to have all the material packaged and structured in an excelent way just in a single book.

Intended audience of the book: for reading it you must have already a working experience on Django. If you want to learn Django, this is absolutely not the first book to go for, so keep it in mind!
But if you have some experience it will teach you the latest best pratices about test and debugging.

Basically, the book is divided in two parts: the first one is about testing, the second about debugging.
In the part about testing you will basically learn about Doc Tests and Unit Tests.
After describing the basic syntax for running tests in Django (the 'test' option of the django-admin utility), the book teach you how to write Doc Tests and what are their advantages. This kind of tests have the advantage to both test code and create documentation at the same time. There are also some disadvantages, as pointed out from the last part of the second chapter.
Chapter 3 shows you how to write effective unit tests, and how to create and use test data (fixtures) for running this tests.
The chapter 4 illustrates in great details the TestCase class, while chapter 5 shows you how to integrate Django with other test tools like Coverage (for determining how much of our code you are effectively testing) and Twill (a convenient way to navigate a web application from command line, if you are not satisfied with the test client API included in Django).

Chapter 6 introduces the second main argument of the book: debugging. After this general introduction and a maybe too much detailed chapter about the debug page and the various type of errors you may find developing web application with Django, in chapter 8 there are excellent indications about how to track SQL queries, how to use the Django Debug Toolbar (a must-have tool for any serious developer!) and the several ways to log from within the application.
Chapter 9 gives a detailed explanation of the pdb debugger (here, in my opinion, the autor should have at least mentioned the ipdb debugger, that basically is pdb for using within ipython for having tab completion and nice tracebacks).
Chapter 10 gives other options if you are in a situation where all the other tools are failing: for example it shows you how to use the Django Project web site for researching help, for accessing (and creating) tickets and understanding their history and if a fixed has been released (basically is a Trac guide): maybe quiete obvious information for dedicating a whole chapter at it.
Finally last chapter is about deploying a Django web site in production: after a basic tutorial for creating the WSGI script (actually the recommended way to deploy a Python web site), and an Apache virtual host, this chapter will show you how to debug Apache if problems arise and how to test multithreaded behavior.

Principal benefits from this book
---------------------------------
- Nice structure of the topics
- Every chapter is built on the previous one, through a very nice step by step tutorial (a survey application). Note that, as not in many books, the whole code is perfectly working even for latter Django releases
- Excellent collection of best practices for a developer: this book will make the difference!

Const
-----
- Too much details in some case (for example the bug section, as already other reviewers have indicated, and the many pages dedicated to the Django tracking system), and this is the reason because I give 4 stars and not 5

In any case, for people willing to make serious test-driven agile development with this beautiful web framework, this is a must-have book!
Comment | 
Was this review helpful to you?
5.0 out of 5 stars Great book, recommended 28 May 2010
Format:Paperback
This book is nothing if not ambitious. Weighing in at over 400 pages, it aims to highlight the development of an entire web app, start to finish, with a particular emphasis on the testing and debugging tools that Django provides.

Starting with the fundamentals of doctests and unit tests, the book also discusses what should be tested - not just how. And in doing this, the book reveals its target audience. I would particularly recommend this book for the following groups of people: developers who are relatively new to Django, and developers who are new to MVC frameworks in general.

The book then moves on to describe some of the tools you can use to extend Django's testing and debugging capabilities - the django-debug-toolbar, and Twill to name two.

A detailed discussion of Django error pages comes next, before what was, for me, the highlight of the book: an examination of PDB - the Python Debugger. If, like me, your initial exposure to Python came through Django, then you might well have missed some of the gems that the standard library contains, such as PDB. The book contains a detailed walkthrough of how to use PDB, and if you haven't used it before, well, you'll love it.

The book ends with a chapter on deployment, even including a section on load testing. Advanced topics such as testing threading issues are covered here too, ensuring that even seasoned Django developers will learn something from this book.

The book's greatest strength is its breadth - covering the entire development process from start to finish. If there's one flaw though, it is that it goes into a little too much detail in places. Like Juho, I could have done without the section on reporting bugs in Django.

You shouldn't let that put you off though - if the worst criticism I can muster is 'too much detail', that has to be a good thing! In particular, if you want to learn how to test your Django applications properly, or are new to Django and want to see the testing and debugging tools on offer, I would wholeheartedly recommend this book.
Comment | 
Was this review helpful to you?
4.0 out of 5 stars Decent effort with some nitpicks 26 May 2010
Format:Paperback
Disclaimer: I received a review copy of this book from the publisher, Packt Publishing.

I have been using Django for a few years (since 0.96 I think). My experience with Python spans a couple of years further.

I was excited to receive the book for a review. I expected it to give insight particularly on debugging and deployment. It did manage to reach these goals I set for it to some extent.

It's not the thinnest book around as it spans 400 pages or so. The book uses narrative based on example, a survey application, that's used throughout the book. I can see the merits of this approach to some extent. It sure does give the book some continuity. On the other hand it detracts its value as reference material.

The chapters related to testing felt quite standard material to me. No surprises there. Both doctests and unittest module were covered as expected. Sadly there was no mention of higher level concepts, such as acceptance testing. On the other hand there was some good information about code coverage and twill testing tool that allows you to emulate an actual web browser quite easily.

I think the highlights of the debugging chapters of the book for me were related to the introduction of debug toolbar and logging. There were some parts, such as how to report a Django bug, that felt a bit redundant to me but otherwise it seemed fine. It would have been useful to have some sort of checklists to aid in the debugging process as it tends to be quite formulaic (well, at least for me).

The book ended with an enlightening chapter about deployment. It made some really good points that are going to bite you in an actual production environment. I would have appreciated even more information on deployment while a bit less on others aspects. I understand that might have gone too much out of scope of the book, though.

As mentioned on the book description, it is definitely good to have some experience. I would not recommend this book for total newbies to Django or Python as itself. It's better to pick up some companion book or just refer to the freely available documentation. Unless you are an absolute Django guru, the book is bound to give some insight to the aspects covered.
Comment | 
Was this review helpful to you?
Would you like to see more reviews about this item?
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Listmania!

Create a Listmania! list

Look for similar items by category


Feedback


Amazon.co.uk Privacy Statement Amazon.co.uk Delivery Information Amazon.co.uk Returns & Exchanges