split views into app files
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user