Django By Example Create your own line of successful web applications with Django Antonio Melé BIRMINGHAM - MUMBAI Django By Example Copyright © 2015 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: November 2015 Production reference: 1261115 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78439-191-1 www.packtpub.com Credits Author Project Coordinator Antonio Melé Neha Bhatnagar Reviewers Proofreader Tarun Behal Safis Editing Alasdair Nicol Alex Robbins Indexer Rekha Nair Glen Robertson Derek Stegelman Production Coordinator Aparna Bhagat Commissioning Editor Akram Hussain Cover Work Aparna Bhagat Acquisition Editor Larissa Pinto Content Development Editor Arun Nadar Technical Editor Rupali Shrawane Copy Editor Vatsal Surti About the Author Antonio Melé holds an MSc in Computer Science. He has been developing Django projects since 2006 and leads the django.es Spanish Django community. He has founded Zenx IT, a technology company that creates web applications for clients of several industries. Antonio has also worked as a CTO for several technology-based start-ups. His father inspired his passion for computers and programming. About the Reviewers Tarun Behal is a full-stack software engineer with 4 years of experience in building and delivering high-quality applications using Python, JavaScript, PHP, Ruby, and other open source technologies. He is passionate about software development and enjoys exploring open source projects. Over the years, he has provided consulting services to several organizations and has played many different roles such as cloud administrator, frontend technologies, software architect, ERP consultant, and software developer. Tarun has a bachelors degree in computer engineering from the Uttar Pradesh Technical University, Noida, India. He currently lives in Gurgaon, India and works with Nagarro Software Pvt. Ltd. In the digital world, he can be contacted by e-mail at [email protected]. I feel very honored to have been asked to review this book. This was an amazing experience for me as I learned a lot on the way through, as I am sure you will too. I'd like to thank my family, especially my brother, Varun, and all my colleagues for their constant support and motivation. I feel honored to have been asked to review this book. This was an amazing experience as I learned a lot, as I am sure you will too. Alasdair Nicol is a Python developer from Scotland. He discovered Django in 2009 while learning Python, and was instantly hooked. After 5 years with UK-based hosting provider Memset Hosting, he recently started working at SpatialBuzz, who provide SaaS for mobile network operators. When he's not coding, Alasdair enjoys playing squash and running. Alex Robbins is a programmer living in Dallas, Texas. He loves programming in Clojure and Python, doing anything from web development to data science. He has been using Django since 2008 and enjoying it the whole time. When not programming, he spends his time with his beautiful wife and amazing son. Alex has also contributed distributed processing recipes to Clojure Cookbook and has technically reviewed Enterprise Data Workflows with Cascading. Glen Robertson is a software engineer from New Zealand. He currently works at Lyft, where he builds applications in Python and PHP to help grow their transportation network and fill up more empty car seats on the road. Prior to that, he worked for Trulia, where he built heat-map visualizations with GeoDjango and PostGIS to show local information to homebuyers such as crime rates and commute times. Glen has a bachelor in information technology, majoring in software engineering from Victoria University of Wellington. Derek Stegelman is a senior web application developer at Kansas State University. He works on maintaining Python web applications written using the Django web framework. He has been working with Django for 5 years on websites and applications and actively contributes to the Django community through open source projects. www.PacktPub.com Support files, eBooks, discount offers, and more For support files and downloads related to your book, please visit www.PacktPub.com. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM https://www2.packtpub.com/books/subscription/packtlib Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books. Why subscribe? • Fully searchable across every book published by Packt • Copy and paste, print, and bookmark content • On demand and accessible via a web browser Free access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access. To my parents and my sister. Thank you for always encouraging and supporting me.