mirror of
https://github.com/Crocmagnon/cookiecutter-django.git
synced 2024-05-19 01:52:51 +02:00
13 lines
389 B
Python
13 lines
389 B
Python
import random
|
|
|
|
from django.core.handlers.wsgi import WSGIRequest
|
|
from django.http import HttpResponse
|
|
from django.shortcuts import render
|
|
|
|
|
|
def hello_world(request: WSGIRequest) -> HttpResponse:
|
|
context = {"value": random.randint(1, 1000)}
|
|
if request.htmx:
|
|
return render(request, "common/hello-random.html", context)
|
|
return render(request, "common/base.html", context)
|