class Post(models.Model):
author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
def beats_by_user(request, author):
beats = Post.objects.get(author=author)
return render(request, 'blog/beat_list.html', {'beats': beats})
url(r'^profile_view/(?P<author>\w+)/$', views.beats_by_user, name='beats')