Introducing Tango with Django
Tango with Django is a beginner's guide to web development using the popular Python-based web application framework, Django. The complete book provides a hands-on guide to designing and building web applications, explaining in plain English how all the different technologies you will encounter fit together. All major processes are provided as a series of generalisable workflows to get you into the mindset of using Django quickly, reducing the learning curve, and advocating best practices when developing your web applications.
While teaching you the basics of Django, we will guide you through the implementation of a simple web application, Rango — providing a directory of different categories and links. By the end of the book, you will have fully implemented the application, as well as having deployed it online with the Python application hosting service, PythonAnywhere — ready for the whole world to see your efforts!
-
Setup Smart
Setting up your Python development environment is an important part of any project. We show you how to set up your environment and project so that you can deploy your application in next to no time. -
Learn Fast
This book has been designed to get you going fast and to learn by example. You'll learn the key aspects of the Python Django framework by developing a simple web application called Rango. -
Code Simple
To get you working with the Python Django Framework — and not against it — we have provided a series of different workflows to help you fall into line with the Model-View-Template architecture.
Since our initial draft release in October 2013, Tango with Django has been accessed over 2,000,000 times. Over 6,000 individuals have purchased their own copy of the later editions released on Leanpub since late 2016. The book has been used of the basis as web development courses all around the world, such as in educational institutions in India and Vietnam.
Thousands of students at the University of Glasgow have used the book since 2014 — both undergraduate and postgraduate — to learn the basics of web development as part of the School of Computing Science's curriculum. Indeed, the authors were both employed by the University to teach web development until 2019!
What has made the book a success amongst the student population? How will it help you learn?
-
Save yourself Time
On many occasions we've seen clever students get stuck, spending hours trying to fight with Django and other aspect of web development — usually because a key piece of information was not provided, or something was not clear. While the occasional blip might set you back 10-15 minutes, sometimes issues can take hours to resolve. We’ve tried to remove as many of these hurdles as possible. This will mean you can get on with developing your application, and not figuring out another piece of the puzzle. -
Improve your Workflow
Using web application frameworks requires you to pick up and run with a particular design pattern, so you only have to fill in certain pieces in certain places. After working with many students, we heard lots of complaints about using web application frameworks, about how they take control away from them. To help you, we've created a number of workflows to focus your development process so that you can regain that sense of control and build your web application in a disciplined manner. -
Share your Thoughts
We are always looking for ways to improve this resource. We have open-sourced the book and corresponding Python implementation. We want to hear from you if you have any suggestions, improvements, or just want to contribute to the project! We always listen to reader feedback — a recent reader-suggested improvement has been the inclusion of tests for readers to compare their implementations against, so they know they are on track. -
Lower your Learning Curve
Web application frameworks can save you a lot of hassle and lot of time. But that is only true if you know how to use them! Often the learning curve is steep. This book tries to get you going, and going fast. By showing you how to put together a web application with all the bells and whistles from the onset, the book shortens your learning curve. You'll be satisfied with your progress, even early on.
So what are you waiting for? Get ready to Tango with Django!
Technologies Covered
Students often say they hate web development for the simple fact that there's so many damn technologies that they need to get up to speed with quickly. It often seems overwhelming to beginners.
While we can't avoid you from having to learn all of the key web technologies, we have gone to considerable efforts to make Tango with Django a one-stop-shop for beginners — from introducing you to the basics of server-side programming (with Django and Python), to client-side presentation (CSS) and scripting (JavaScript). Where possible, we employ different frameworks to make the introduction to these different technologies easier for you.
-
Python 3
We make use of Python 3, making use of functions, classes and data structures like dictionaries. All of these essential concepts allow us to drive the Django framework. -
The Django Framework
Django is the core technology covered in this book. Closely following the Model-View-Template architecture, we discuss key concepts such as views (both functional and class-based), data-driven page generation, user authentication, form handling, page templating and a whole lot more. There's a lot in the book — it's over 400 pages long! -
HTML5
Following on from templating, we provide instructions on how to create standards-compliant HTML5 templates that your Rango app will use. -
External APIs
We show you how to connect your Django project up to an external API that provides some additional service. Our tutorial focuses on the SERP API. -
CSS & JavaScript
With the server-side covered by Python and Django, the book introduces you to two key technologies used on the client-side — CSS (for styling) and JavaScript (for scripting). We use the Twitter Bootstrap CSS framework to give your application a good look quickly, and the JQuery framework to make client-side scripting a much more straightforward affair. We also introduce you to the basics of AJAX, allowing for the development asynchronous web applications. -
Git Version Control
A crucial part of software development is being able to work efficiently in a team. From the start, we encourage you to use Git version control system, so you will commit and push regularly! And if you get stuck, we've provided an appendix on the basics of Git. -
Unit Testing
We encourage you to consider test-driven development, and provide you with a series of unit tests that examine the functionality of your implementation.
About the Authors
Tango with Django was launched by two scholars in October 2013 when at the University of Glasgow. We've been working steadily on the book ever since then, with our fifth release now in the pipeline.
We're indebted to the individuals who have supported us over the years; from those who have contacted us with suggestions about how to improve the book, to those reaching out to us with typos — thank you. You're all acknowledged in the book! We'd like to pay particular thanks to Professor David Manlove and Dr Gerardo Aragon-Camarasa for their support, and to Kelly Ann Marshall for her amazing drawing of Rango which helped us kickstart our designs!
Contact & Code
If you'd like to contact us for whatever reason, we'd love to hear from you. Whether you are stuck and need a push in the right direction, or have a comment about the book (be it a typo, or something more substantial), we are always happy to hear from our readers. You can contact us via e-mail or Twitter using our individual addresses and handles provided in the authors section, or you can reach out to us on GitHub. Just raise a new issue in the relevant repository.
-
@tangowithdjango
Follow @tangowithdjango on Twitter. We tweet about things related to the book, so this the ideal medium to receive notifications when updates are released. Alternatively, you can send us a DM if you have any queries and we'll be happy to get in touch with you! -
Book Repository
If you want to raise a specific issue about the book, you can raise an issue within our book's Git repository. Click/tap here to jump to the issues page. -
Code Repository
We also house a complete model implementation of the Rango app (and tests). If you spot a problem with our implementation, or want to query why we did something, raise an issue on the code repository. Click/tap here to do so.
Book Editions
We've released five editions of Tango with Django since 2013. Each version is updated to the latest Django framework — along with additional content and features. The latest verision is available to purchase via LeanPub, otherwise you can download the previous versions for free.
- Tango with Django For Django 4.0+ Also compatible with Django 4.1+/4.2+ Released July 2023 From US$15.99
- Tango with Django For Django 2.0+ Also compatible with Django 2.1+/2.2+ Released September 2019 $FREE
- Tango with Django For Django 1.9 Also compatible with Django 1.10 and 1.11 Released October 2016 $FREE
- Tango with Django For Django 1.7 Released January 2015 $FREE
- Tango with Django For Django 1.5 Released October 2013 $FREE