Files
Projet13/profiles/views.py
2025-09-05 16:45:38 +02:00

13 lines
429 B
Python

from django.shortcuts import render
from profiles.models import Profile
def index(request):
profiles_list = Profile.objects.all()
context = {'profiles_list': profiles_list}
return render(request, 'profiles/index.html', context)
def profile(request, username):
profile = Profile.objects.get(user__username=username)
context = {'profile': profile}
return render(request, 'profiles/profile.html', context)