Prerequisites

Before we dive in, this chapter is an outline of the knowledge and software requirements you’ll need to follow the examples in this book.

Python

This book is aimed at developers with at least some previous Python experience, and in this book we are using Python 3. In particular, the examples have been tested to run on Python 3.3 and 3.4. Those familiar enough with Python may be able to work through this book using Python 2.7, converting the example code as needed, though it is not recommended. To read more about what is new in these versions of Python and to find installation instructions for your system, visit https://www.python.org/downloads/.

We expect that you have Python installed on your local development machine, know how to edit Python files, and know how to run them. Throughout this book, when we reference Python on the command line, we will use python, though some systems or installations may require using python3 or the full version, such as python3.3 or python3.4. Similarly, when installing new packages, the examples will use pip, though some installations may require using pip3. For this book, and Python development in general, it is recommended that you create an isolated Python environment for each project using virtualenv. Without an isolated environment, installing new Python packages with pip may require root access or administrative rights on your computer. We’ll assume that if this is the case, you will prefix the pip command with sudo or any other commands you may need to gain such rights, but those prefixes will not be shown in the examples.

Python Packages

The only Python package that is required before you start this book is Django. All of the examples have been tested and written to work with Django 1.8. It is recommended that you install with pip:

hostname $ pip install Django==1.8.3

Note

As of July 2015, Django 1.8.3 is the current stable release. The 1.8 version has been labeled a long term support release and will be supported until at least April 2018. During that time there may be additional bug fixes and security releases denoted by 1.8.X. It is expected that these releases will continue to work with the examples provided here, and it is recommended that you always use the latest security release.

To read more about what is new in this version of Django, visit https://docs.djangoproject.com/en/dev/releases/1.8/. For additional installation instructions, you can also see the Django guide on installation.

Additional packages will be installed throughout the chapters. Chapters 1, 2, and 3 are each independent projects and can be treated as separate virtual environments, again with Django being the only prerequisite. Chapters 4 through 8 comprise one large project, and the same virtual environment should be used for those chapters.

Web Development

As Django is a web framework, this book assumes you have some basic knowledge of HTML and CSS. The JavaScript examples are more in depth, and the expected level of knowledge is detailed more in the following section. A basic understanding of the HTTP protocol, in particular the usage and purpose of the various HTTP verbs (GET, POST, PUT, DELETE, etc.), is helpful.

JavaScript

The later chapters in this book make heavy use of JavaScript. You should also be familiar with writing JavaScript/jQuery. A developer experienced doing DOM manipulation and making AJAX calls with jQuery should be able to follow the examples using Backbone.js. If you are familiar with another client-side framework such as Angular.js, Ember.js, or Knockout.js, you will be ahead of the game. This is not meant to be a definitive guide on Backbone.js. If you are not familiar with working with JavaScript, and Backbone.js MVC architecture in particular, here are some recommended O’Reilly titles for you to read:

Browser Support

The examples in this book make use of relatively new HTML5 and CSS3 APIs, and expect a modern browser. Anything below these versions has not been tested thoroughly and/or may not support the technology that we use in the examples:

  • IE 10+
  • Firefox 28.0+
  • Chrome 33.0+

You should be familiar with using the developer tools in your preferred browser to debug potential errors, see network requests, and use the JavaScript console.

Additional Software

Later chapters will make use of two popular databases: PostgreSQL and Redis. Brief installation instructions are noted in the chapters where needed, but you should refer to the official documentation for a more complete guide for your system.

PostgreSQL is an open source relational database system that has strong support in the Django community. Any version of PostgreSQL supported by Django will work for this book. Django 1.8 supports PostgreSQL 9.0 and higher.

Redis is an open source key/value cache. This book makes use of the pub/sub features of Redis and requires 2.0 and higher.

Get Lightweight Django now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.