Django 2 by Example

by Antonio Melé

Django 2 by Example

by Antonio Melé

Build powerful and reliable web applications from scratch

Download free chapter

Learn Django building practical, real-world applications

Django 2 by Example will guide you through the entire process of developing professional web applications with Django.

This book will walk you through the creation of four professional Django projects, teaching you how to solve common problems and implement best practices.

The book begins by showing you how to build a blog application, before moving on to developing a social image bookmarking website, an on-line shop and an e-learning platform.

You will learn how to build a search engine and you will implement a user activity stream. Furthermore, you will create a recommendation engine, an e-commerce coupon system and a content management system.

The book will also teach you how to enhance your applications with AJAX, create RESTful APIs and setup a production environment for your Django projects.

After reading this book, you will have a good understanding of how Django works and how to integrate it with other technologies to build practical, advanced, web applications.

Download a free chapter

Enter your name and e-mail to download a free chapter

What people say

This book stems from the experience acquired by Antonio during several years spent in the field developing real-world applications. If you've ever asked yourself "how something should be done", you will most likely find a solid answer here.

Giuseppe Ciotta
CTO at Ticketea

The topics covered on this book are based on real work situations, that will help you get the job done and learn in the process! Extensive analysis of each problem that takes you from point A to point B. A must have if you're looking into doing Django based projects professionally.

Panos Laganakos
Independent Python/Django Developer

The topics covered in Django 2 by Example are among the most demanded by the web industry today. This book is the perfect extension to the official Django documentation, and is as good a reading experience for perfectionists with deadlines as for those looking to build a professional website, no matter whether you want a publishing web portal or a real working shopping web site.

Daniel Rus
Software Engineer at DLR GfR

The examples in the book are just awesome! This is a hands-on guide on how to do real world applications. If you are new to Django, I'd recommend you to read this book and build the example applications. You'll be doing great stuff in no time!

Jaakko Tulkki
Lead Developer at Barclays

Use Django with multiple technologies

Learn how to integrate Redis, Celery/RabbitMQ and Memcached into your Django project.

Build four different real-world applications

  • Learn how to create a project with Django
  • Create the basic blog models, views, templates and URLs to display blog posts
  • Use the Django ORM to build database querysets
  • Configure the Django administration site
  • Handle form and modelforms with Django
  • Allow users to comment on blog posts
  • Allow users to share posts by sending e-mails with Django
  • Integrate third-party applications into your project
  • Implement a tagging system using django-taggit
  • Create custom template tags and filters
  • Create a sitemap for your blog
  • Create a RSS feed for your latest posts
  • Build a full-text search engine using the PostgreSQL contrib package
  • Build a social website
  • Use the authentication framework to build user account views
  • Create a custom user profile model
  • Build social authentication into your project using Facebook, Twitter and Google+
  • Transform your social application into an image bookmarking website
  • Define many-to-many relationships for models
  • Create an AJAX bookmarklet using JavaScript and integrate it into your project
  • Generate image thumbnails with sorl-thumbnail
  • Create custom decorators for your views
  • Build a follower system for users
  • Create a user activity stream application
  • Optimize querysets
  • Learn how signals work
  • Integrate Redis into your project to count image views
  • Create an online shop
  • Build the catalog models
  • Create a shopping cart using sessions
  • Manage customer orders
  • Send asynchronous notifications to users using Celery
  • Integrate a payment gateway into your shop
  • Handle asynchronous notifications
  • Customize the administration site to export orders to CSV files
  • Generate PDF invoices dynamically
  • Create a coupon system to apply discounts to orders
  • Add internationalization to your project
  • Translate models using django-parler
  • Build a product recommendation engine using Redis
  • Create an e-learning platform
  • Add data fixtures to your project
  • Learn how to use model inheritance
  • Create custom model fields
  • Implement class-based views (CLB)
  • Manage groups and permissions
  • Build a content management system
  • Handle formsets
  • Create a student registration system
  • Manage student enrollment in courses
  • Render diverse course contents
  • Learn how to use the cache framework
  • Cache your data with Memcached
  • Build a RESTful API using Django REST framework
  • Setup a production environment using uWSGI and Nginx

  • Secure your production environment with SSL
  • Build a custom subdomain middleware
  • Create custom management commands

About the author

Antonio Melé is the CTO of Exo Investing and the founder of Zenx IT. Antonio has been developing Django projects since 2006 for clients in several industries. He has been working as the CTO and as a technology consultant for multiple technology-based start-ups, and he has managed development teams building projects for large digital businesses. Antonio holds a master's in computer science from Universidad Pontificia Comillas.