split views into app files

This commit is contained in:
2025-09-05 16:45:38 +02:00
parent 6f3e7dc79f
commit 15ea4c8abf
2 changed files with 25 additions and 2 deletions

View File

@@ -1,3 +1,13 @@
from django.shortcuts import render
from profiles.models import Profile
# Create your views here.
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)