Hotel/hotel/rooms/views.py

14 lines
347 B
Python
Raw Normal View History

from django.http import HttpResponse
from django.template import loader
from django.shortcuts import get_object_or_404, render
from .models import *
# Create your views here.
def index(request):
rooms = Room.objects.all()
template = loader.get_template('index.html')
return HttpResponse(template.render({'rooms': rooms}, request))