Skip to content

Latest commit

Β 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Django Form & ORM Operations

A beginner-friendly Django web application demonstrating HTML Form handling and Django ORM operations through a simple Course Management System.

🌐 Live Demo: django-form-orm-operations.onrender.com
πŸ“ Repository: fahadbinsiddique/Django-Form-ORM-Operations


πŸ“Œ About The Project

This project was built to practice core Django concepts β€” specifically how to take user input through HTML forms and store/retrieve data using Django's powerful ORM (Object Relational Mapper). It manages three entities: Students, Courses, and Enrollments.


✨ Features

  • βž• Add new Students, Courses, and Enrollments via HTML forms
  • πŸ“‹ View all records in a clean table layout
  • πŸ” View individual record details
  • πŸ”Ž Filter data using ORM queries
  • πŸ› οΈ Django Admin Panel support
  • 🎨 Responsive UI with Template Inheritance

πŸ› οΈ Tech Stack

Technology Usage
Python 3.14 Backend language
Django 6.x Web framework
SQLite Database
HTML & CSS Frontend
Render Deployment platform

πŸ“‚ Project Structure

my_project/
β”œβ”€β”€ my_app/
β”‚   β”œβ”€β”€ migrations/
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   β”œβ”€β”€ masters/
β”‚   β”‚   β”‚   β”œβ”€β”€ base.html
β”‚   β”‚   β”‚   └── nav.html
β”‚   β”‚   β”œβ”€β”€ home.html
β”‚   β”‚   β”œβ”€β”€ student.html
β”‚   β”‚   β”œβ”€β”€ student_details.html
β”‚   β”‚   β”œβ”€β”€ course.html
β”‚   β”‚   β”œβ”€β”€ course_details.html
β”‚   β”‚   β”œβ”€β”€ enrollment.html
β”‚   β”‚   └── enroll_details.html
β”‚   β”œβ”€β”€ admin.py
β”‚   β”œβ”€β”€ models.py
β”‚   β”œβ”€β”€ views.py
β”‚   └── urls.py
β”œβ”€β”€ my_project/
β”‚   β”œβ”€β”€ settings.py
β”‚   └── urls.py
β”œβ”€β”€ manage.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ Procfile
└── runtime.txt

πŸ—„οΈ Models

Student_Model

Field Type
name CharField
email CharField
phone CharField
address TextField

Course_Model

Field Type
title CharField
fee IntegerField
duration IntegerField
instructor_name CharField

Enrollment_Model

Field Type
student_name CharField
course_title CharField
status CharField

βš™οΈ ORM Queries Used

# Create a new record
Student_Model.objects.create(name=..., email=..., phone=..., address=...)

# Get all records
Student_Model.objects.all()

# Get a single record by ID
Student_Model.objects.get(id=1)

# Filter records by condition
Student_Model.objects.filter(name="John")
Course_Model.objects.filter(fee__gt=3000)  # fee greater than 3000
Enrollment_Model.objects.filter(status="Not Enrolled")

πŸš€ Getting Started

Prerequisites

  • Python 3.x installed
  • pip installed

Installation

# 1. Clone the repository
git clone https://github.com/fahadbinsiddique/Django-Form-ORM-Operations.git

# 2. Navigate to project folder
cd Django-Form-ORM-Operations/my_project

# 3. Install dependencies
pip install -r requirements.txt

# 4. Run migrations
python manage.py migrate

# 5. Start the development server
python manage.py runserver

Then open your browser and go to: http://127.0.0.1:8000


πŸ”— URL Routes

URL Description
/ Home Page
/student Student list & add form
/course Course list & add form
/enroll Enrollment list & add form
/student-details/<id>/ Single student details
/course-details/<id>/ Single course details
/enroll-details/<id>/ Single enrollment details

🧠 What I Learned

  • How Django ORM works under the hood
  • Handling GET and POST requests in views
  • Template inheritance to avoid code repetition
  • Deploying a Django project on Render

πŸ™‹β€β™‚οΈ Author

Fahad Bin Siddique


πŸ“„ License

This project is open source and available under the MIT License.

About

A Django project practicing HTML Form handling and ORM operations β€” Create, Read, Filter with Student, Course & Enrollment models. Deployed on Render. πŸš€

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages