Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Capture URL parameters and display them.
# views.py
from django.shortcuts import render
def user_view(request, user_id):
return render(request, 'user.html', {'user_id': user_id})
# urls.py
from django.urls import path
from .views import user_view
urlpatterns = [
path('user/<int:user_id>/', user_view),
]
# user.html
"""
<p>User ID: {{ user_id }}</p>
"""Django is a high-level Python web framework that encourages rapid development, clean design, and pragmatic code. It includes built-in tools for ORM, authentication, routing, and templating.
Origin & Creator
Django was created by Adrian Holovaty and Simon Willison in 2005 at the Lawrence Journal-World newspaper.
Industrial Note
Django is used heavily in industries requiring rapid prototyping, content management systems, and scalable web applications, e.g., news, e-commerce, and SaaS.