Chapter 1. The World’s Smallest Django Project
How many of our journeys into using Django have begun with the official polls tutorial? For many it seems like a rite of passage, but as an introduction to Django it is a fairly daunting task. With various commands to run and files to generate, it is even harder to tell the difference between a project and an application. For new users wanting to start building applications with Django, it begins to feel far too “heavy” as an option for a web framework. What are some ways we can ease these new users’ fears to create a clean and simple start?
Let’s take a moment to consider the recommended tasks for starting a Django project. The creation
of a new project generally starts with the startproject command. There is no real magic to what
this command does; it simply creates a few files and directories.
While the startproject command is a useful tool, it is not required in order to start a Django project. You
are free to lay out your project however you like based on what you
want to do. For larger projects, developers benefit from the code organization
provided by the startproject command. However, the convenience of this command shouldn’t stop
you from understanding what it does and why it is helpful.
In this chapter we’ll lay out an example of how to create a simple project using Django’s basic building blocks. This lightweight “Hello World” project will create a simple Django application using a single-file approach.
Hello Django
Building a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access