Programming Examples
Django program to print hello word in view
Create a simple "Hello, World!" view. in Django
Solution :
views.py
from django.http import HttpResponse def hello_world(request): return HttpResponse("Hello, World!")
urls.py
from django.urls import path from .views import hello_world urlpatterns = [ path('hello/', hello_world, name='hello_world'), ]
Output