1. django-app

Basics of Django

Django is a high-level Python web framework that allows developers to create web applications quickly and easily. It follows the Model-View-Controller (MVC) pattern and emphasizes reusability and rapid development.


To run a basic Django project, the following syntax is used:

python runserver

This command starts the server at


Let's create a simple Django application that displays "Hello, World!" on the web page.

from django.http import HttpResponse

def hello(request):
   return HttpResponse("Hello, World!")


When we run the server, and navigate to, we will see "Hello, World!" displayed on the page.


In the above example, we define a function called hello that returns an HttpResponse object with the "Hello, World!" message. We map the hello function to the URL /hello using the file.


Django can be used to create web applications for a variety of purposes, such as:

  • Building e-commerce sites
  • Developing social networking applications
  • Creating content management systems
  • Building web-based scientific tools

Important Points

  • Django follows the Model-View-Controller (MVC) pattern.
  • It emphasizes reusability and rapid development.
  • It provides built-in tools for authentication, content administration, and caching.


In this section, we learned about the basics of Django, such as its syntax, example, output, explanation, use, important points, and summary. Django is an excellent tool for creating web applications quickly and easily. With Django, developers can focus on writing applications without worrying about the underlying infrastructure.

Published on: