Tango with DjangoRevised & updated

Learn web development with Python and Django
Made with ❤️ in Scotland Scottish Saltire
Over 6,000 copies sold

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!

  • Lightbulb

    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.
  • Speedometer

    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.
  • Computer Screen

    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?

  • Hourglass

    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.
  • Workflow

    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.
  • Discussion

    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.
  • Curve Plot

    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 Logo

    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.
  • Django Logo

    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 Logo

    HTML5

    Following on from templating, we provide instructions on how to create standards-compliant HTML5 templates that your Rango app will use.
  • APIs

    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 Microsoft Bing Search API.
  • Web Browser

    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 Logo

    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.
  • Testing

    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.
  • Deployment

    Deploying to the Web

    Our final key technology covered is how to deploy your finished implementation to a web hosting service. Moving from your device to the web, we choose PythonAnywhere for ease of use, showing you how to clone your project and set up the web server for your finished application.

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 fourth release now finalised.

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.

Book Editions

We've released four editions of Tango with Django since 2013. Each version was tweaked to work with later versions of the Django framework — along with the addition of extra bits and pieces. Previous versions are still available for your reference, though we highly recommend that if you are starting out, you start with the latest version! To access a previous version, just click/tap the relevant box below.