Django Model with CharField, IntegerField, and DateField
📖 Scenario: You are building a simple Django app to store information about books in a library. Each book has a title, a number of pages, and a publication date.
🎯 Goal: Create a Django model named Book with three fields: a title using CharField, a pages using IntegerField, and a published_date using DateField.
📋 What You'll Learn
Create a Django model class named
BookAdd a
title field using CharField with max length 100Add a
pages field using IntegerFieldAdd a
published_date field using DateField💡 Why This Matters
🌍 Real World
Django models are used to define the structure of data stored in a database for web applications.
💼 Career
Understanding Django field types is essential for backend web development roles using Django framework.
Progress0 / 4 steps