Add user detail view
authorDavid Kerkeslager <kerkeslager@gmail.com>
Fri, 4 Mar 2022 16:29:22 +0000 (11:29 -0500)
committerDavid Kerkeslager <kerkeslager@gmail.com>
Fri, 4 Mar 2022 16:29:22 +0000 (11:29 -0500)
src/user_profile/templates/auth/user_detail.html [new file with mode: 0644]
src/user_profile/views.py

diff --git a/src/user_profile/templates/auth/user_detail.html b/src/user_profile/templates/auth/user_detail.html
new file mode 100644 (file)
index 0000000..1ff382b
--- /dev/null
@@ -0,0 +1,5 @@
+{% extends 'core/base.html' %}
+
+{% block content %}
+{{ object.username }}
+{% endblock %}
index 408880e..41498b6 100644 (file)
@@ -1,8 +1,11 @@
+from django.contrib.auth.models import User
+from django.shortcuts import get_object_or_404
 from django.views.generic.detail import DetailView
 
-from . import models
-
 class UserProfileDetailView(DetailView):
-    model = models.UserProfile
+    model = User
+
+    def get_object(self):
+        return get_object_or_404(User, username=self.kwargs['username'])
 
 user_profile_detail = UserProfileDetailView.as_view()