Skip to content

Roxtop07/Email-Sender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django • Flask • REST API

Backend Fundamentals

A well-structured repository covering Django, Flask, and REST APIs — built for learning, revision, and practical viva preparation.
This repo focuses on core backend concepts, clear explanations, and exam-ready clarity.


🚀 Tech Stack Covered

  • Django – Full-featured Python web framework
  • Flask – Lightweight micro web framework
  • REST API – Stateless backend communication standard

📌 Django

What is Django?

Django is a high-level Python web framework that follows the MVT (Model–View–Template) architecture and enables rapid development of secure, scalable, database-driven web applications.

Django Architecture (MVT)

  • Model → Database layer (ORM)
  • View → Business logic & request handling
  • Template → Presentation layer (HTML)

Key Django Features

  • Built-in ORM
  • Admin panel
  • Authentication & authorization
  • Security (CSRF, XSS, SQL injection protection)
  • Rapid development

Important Django Components

  • models.py → Database schema
  • views.py → Application logic
  • urls.py → URL routing
  • settings.py → Project configuration
  • manage.py → Command-line utility

Migrations

  • makemigrations → Create migration files
  • migrate → Apply changes to database

📌 Flask

What is Flask?

Flask is a lightweight (micro) Python web framework used to build web applications and REST APIs.

Why Flask is called a Micro-framework?

Flask provides only core features like routing and request handling.
Additional functionality is added using extensions.

Core Flask Concepts

  • @app.route() → URL routing
  • View functions → Handle requests
  • render_template() → Render HTML templates
  • request → Client request data
  • jsonify() → JSON responses
  • Jinja2 → Template engine

Flask Strengths

  • Simple and flexible
  • Easy to learn
  • Ideal for APIs and small to medium projects

Flask Limitations

  • No built-in ORM
  • No admin panel
  • Requires manual structure and security setup

📌 REST API

What is an API?

API (Application Programming Interface) allows communication between two applications.

What is REST?

REST (Representational State Transfer) is an architectural style that uses HTTP to manage resources.

What is a REST API?

A REST API uses HTTP methods to perform operations on resources in a stateless manner.

HTTP Methods

Method Operation
GET Fetch data
POST Create data
PUT Update data
DELETE Remove data

REST Characteristics

  • Stateless
  • Client-server architecture
  • Uses JSON for data exchange

Common HTTP Status Codes

Code Meaning
200 OK
201 Created
400 Bad Request
401 Unauthorized
404 Not Found
500 Server Error

📌 REST API with Frameworks

  • Django → Django REST Framework (DRF)
  • Flask → Flask routes + jsonify() / Flask-RESTful

⚖️ Django vs Flask

Django Flask
Batteries-included Lightweight
Opinionated Flexible
Built-in ORM & Admin Extension-based
Best for large systems Best for APIs & small apps

❌ Common Mistakes (Avoid These)

  • Django follows MVC ❌
  • Flask follows MVT ❌
  • REST is a protocol ❌
  • GET modifies data ❌
  • Flask has built-in admin ❌

✅ Key Takeaways

  • Django is structured and full-featured
  • Flask is flexible and minimal
  • REST APIs are stateless and resource-based
  • Django + Flask + REST form a strong backend foundation

🎯 Who This Repo Is For

  • B.Tech / MCA students
  • Backend beginners
  • Django & Flask learners
  • Practical viva preparation
  • Revision before exams or interviews

❤️ Made With Love

Built with focus, clarity, and real understanding
by Manish Srivastav

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages