Book Image

Django Essentials

By : Samuel Dauzon
Book Image

Django Essentials

By: Samuel Dauzon

Overview of this book

<p>Django is a powerful Python web framework designed for rapid web application development. With the advent of frameworks such as Django, web developers have been forced to adopt MVC architectures and are encouraged to develop quality code. This quality allows several developers to work together easily and reduces the number of bugs due to human errors.</p> <p>Beginning with the basics of the Web and Django, the book explains the MVC pattern. It then moves on to explain the step-by-step installation of Python, PIP, and Django on Windows, Linux, and Mac OS. Furthermore, you will learn how to create templates, models, forms, and so on. After reading the book, you will be able to quickly create dynamic web applications with AJAX and an admin part.</p> <p>This book features a step-by-step approach that shows you how to program, create, and improve the quality of web applications using Django, with the help of Python.</p>
Table of Contents (20 chapters)
Django Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing Django


We will then install the framework on which we will be working. The following sections describe how we can install Django on different operating systems.

Installing Django for Windows

To install Django with PIP, you have to open a command prompt and go to the Scripts directory that you can find in the Python folder. You can install Django with the following command:

C:\Python33\Scripts\pip.exe install django=="X.X"

PIP will download and install the Django packages in the site-packages repository of Python.

Installing Django for Linux

To facilitate the PIP utilization that we have just installed, we have to look for the version installed on the system and define an alias to refer to the PIP version installed. Do not forget to execute the following commands as root:

root@debian:compgen -c | grep pip
root@debian:alias pip=pip-3.2
root@debian:pip install django=="1.6"

The first command looks for a usable command containing the word pip. You will certainly find a line such as pip...