djangoEasy Examples

Full-stack web framework with ORM, admin panel, auth, templates, migrations

Getting started with django

Installation and basic usage of django.

python
# Install: pip install django
# In views.py
from django.http import HttpResponse
from django.shortcuts import render

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

def home(request):
    context = {"title": "My Site", "items": [1, 2, 3]}
    return render(request, "home.html", context)
Expected Output
# Expected output shown below
# (Run locally with: django)

django is a third-party package. Full-stack web framework with ORM, admin panel, auth, templates, migrations. Install with: pip install django

Common django operations

Frequently used features of django.

python
# Install: pip install django
import django

# Common django patterns
print(f"django version: {django.__version__}")

These are the most commonly used features of django in everyday development.

Want to try these examples interactively?

Open Easy Playground