Wednesday, 7 January 2026

Django Module 2 — Project & App Structure

Django Module 2 – Project & App Structure

๐Ÿ“˜ Django Tutorial – Module 2

Topic: Django Project & App Structure


๐ŸŽฏ Learning Objectives

  • Understand Django project vs app
  • Create a Django app
  • Explore Django folder structure
  • Register app in settings

๐Ÿ”น What is a Django Project?

A Django project is the entire web application. It contains settings, URLs, and configuration.

๐Ÿ”น What is a Django App?

A Django app is a module that performs a specific function (e.g., blog, accounts, attendance).

๐Ÿ”น Step 1: Create Django App


python manage.py startapp blog
  

๐Ÿ”น Step 2: Project Structure


mysite/
│
├── blog/
│   ├── admin.py
│   ├── apps.py
│   ├── models.py
│   ├── tests.py
│   └── views.py
│
├── mysite/
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
│
└── manage.py
  

๐Ÿ”น Step 3: Register App in settings.py


INSTALLED_APPS = [
    'blog',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]
  

๐Ÿ”น Step 4: Run Server Again


python manage.py runserver
  

๐Ÿงช Student Practice

  • Create another app named pages
  • Add it to INSTALLED_APPS
  • Observe the folder structure

❓ Viva / Exam Questions

  1. What is the difference between Django project and app?
  2. Why do we add apps to INSTALLED_APPS?
  3. What is the role of manage.py?
๐ŸŽ“ Classroom Tip Keep Module 1 & Module 2 HTML files open Let students copy commands directly Ask them to explain project structure verbally

No comments:

Post a Comment

Django #7a Project Sample

Employee Management System – Django (HRMS) Employee Management System (Django + MySQL) Roles: Admin, HR, Employee 1....