0
0
Djangoframework~5 mins

What is Django

Choose your learning style9 modes available
Introduction

Django helps you build websites quickly and easily. It gives you ready tools so you don't have to start from scratch.

You want to create a blog or news site fast.
You need a secure website with user login and data storage.
You want to build an online store with product listings.
You want to manage content without writing too much code.
You want to focus on your website ideas, not on low-level details.
Syntax
Django
django-admin startproject projectname
python manage.py runserver
Use django-admin startproject to create a new Django project.
Use python manage.py runserver to start the website locally.
Examples
This creates a new Django project folder named mysite.
Django
django-admin startproject mysite
This runs the website on your computer so you can see it in a browser.
Django
python manage.py runserver
Sample Program

This code shows a simple webpage that says 'Hello, Django!'. It uses a function called a view to send text to the browser.

Django
# This is a simple Django view example
from django.http import HttpResponse

def home(request):
    return HttpResponse('Hello, Django!')
OutputSuccess
Important Notes

Django follows a pattern called MVC but calls it MTV (Model-Template-View).

Django includes built-in tools for security, like protection against hackers.

You can add apps inside a Django project to organize different parts of your website.

Summary

Django is a tool to build websites quickly and safely.

It helps manage data, users, and pages with less code.

It is great for beginners and professionals alike.