Exploring the Django project structure
We already introduced Django projects in the Scaffolding a Django project and app section. Let’s remind ourselves of what happens when we run startproject
(for a project named myproject
) – the command creates a myproject
directory with one file called manage
.py
, and a directory called myproject
(this matches the project name; in Exercise 1.01 – creating a project and app, and starting the development server, this folder was called bookr
, the same as the project). The directory layout is shown in Figure 1.8. We’ll now examine the manage.py
file and myproject
package contents in more detail.
Figure 1.8 – The project directory for myproject
As the name suggests, manage.py
is a script that is used to manage your Django project. Most of the commands that are used to interact with your project will be supplied to this script on the command line. The commands are supplied as an argument...