Intro to Django Lab Exercise
Introduction to building your first Django app
This lab is your chance to dive into the world of Django by building a simple yet practical polls application. To guide you on this exciting journey, we’ll leverage the best resource available: Django’s official documentation.
Why learn from the official Django documentation?
Here’s why the official documentation is your secret weapon:
- Unmatched Comprehensiveness: It covers everything you need, from step-by-step app creation guides to best practices that will become second nature in your Django development.
- Structured Learning: The documentation is well-organized, making it easy to find what you need and follow along.
- Invaluable Reference: This won’t be your last encounter with the Django docs. Throughout your development journey, they’ll be your go-to resource for in-depth information.
This lab serves a dual purpose: it introduces you to Django and equips you with the skills to navigate and utilize the official documentation effectively.
Exercise
You will be following the “Writing your first Django app” tutorial directly from the Django documentation. This hands-on tutorial will guide you through creating a basic poll application. It’s designed to give you a practical understanding of how Django applications are built from scratch. For this lab, you will complete Parts 1 through 4 of the tutorial. The subsequent parts of the tutorial cover topics that we will explore together in future lessons.
Important note:
Before starting the tutorial, we will walk you through the setup and installation of Django in our lab setup lesson. Therefore, you do not need to perform any setup or installation steps described in the tutorial. You can jump straight into the tutorial starting at Tutorial: Part 1.
Tutorial links
Begin the tutorial here: Writing your first Django app, part 1
This tutorial series will cover:
- Part 1: Requests and responses
- Part 2: Models and the admin site
- Part 3: Views and templates
- Part 4: Forms and generic views
- We will skip Parts 5 and beyond for now, as they will be touched on in a future lesson.
Learning objectives
By completing this tutorial, you will:
- Gain hands-on experience in setting up a Django project.
- Understand the basics of Django models, views, and templates.
- Learn how to configure Django’s automatically-generated admin site.
- Practice developing functional web applications with Django.
We encourage you to carefully follow the tutorial and try to understand the rationale behind each step. If you encounter challenges, review the relevant sections of the tutorial or discuss them with your classmates. The skills you acquire here will be essential as you progress to more complex Django projects.
Let’s get started on building your first Django application and diving deep into the world of web development with one of the most popular frameworks today!