1. django-project

Basics of Django

Django is a high-level python web framework which allows rapid development of secure and maintainable websites. It was created to make web development easier and efficient, with its components designed to work together in a unified manner. Here are some basics of Django:


Django follows the Model-View-Template (MVT) architecture. Here is a basic syntax for a URL in Django:

from django.urls import path
from . import views

urlpatterns = [
    path('', views.index, name='index'),


Let's create a simple app called "hello" in Django.

# hello/

from django.http import HttpResponse

def hello(request):
    return HttpResponse("Hello, Django!")
# hello/

from django.urls import path
from . import views

urlpatterns = [
    path('hello/', views.hello, name='hello'),


If you access the URL localhost:8000/hello in your browser, you will see the message "Hello, Django!".


  • In the file, we define a function named hello which returns an HttpResponse object.
  • In the file, we define a URL pattern for the hello function.
  • When we access the URL specified by the pattern, Django calls the hello function and sends the returned response to the client.


Django is used to develop web applications of all types and sizes. It is ideal for building secure, scalable, and maintainable websites.

Important Points

  • Django uses the ORM (Object-Relational Mapping) to interact with the database, which allows us to use python syntax instead of SQL.
  • Django allows easy integration with various third-party packages and frameworks via its large collection of packages called "Django Packages".
  • Django is highly scalable and can be used to build complex web applications.


Django is a powerful web framework that follows the MVT architecture, has a large collection of packages and is ideal for building scalable web applications. With its easy-to-use ORM and vast community resources, it is a great choice for developers looking to build secure and maintainable websites quickly.

Published on: