Pratyush Desai fc6593329b
Redirect to game_detail
The redirect works now. So if you click on a game,
 it wilk take you there

Signed-off-by: Pratyush Desai <pratyush.desai@liberta.casa>
2025-02-11 19:38:01 +05:30

17 lines
609 B
Python

from django.shortcuts import render, get_object_or_404
from .models import Game, Server
def home(request):
"""Display the home page with links to other views."""
games = Game.objects.all() # Fetch all games
return render(request, 'webpanel/home.html', {'games': games})
def games(request):
games = Game.objects.all()
return render(request, 'webpanel/games.html', {'games': games})
def game_detail(request, game_name):
print(f"Looking for game: {game_name}")
game = get_object_or_404(Game, name=game_name)
return render(request, 'webpanel/game_detail.html', {'game': game})