diff --git a/studysite/templates/studysite/users.html b/studysite/templates/studysite/users.html new file mode 100644 index 0000000..e931768 --- /dev/null +++ b/studysite/templates/studysite/users.html @@ -0,0 +1,26 @@ +{% extends 'studysite/base.html' %} +{% load socialaccount %} +{% load static %} + +{% block content %} + +

Users:

+ + + +{% endblock %} \ No newline at end of file diff --git a/studysite/urls.py b/studysite/urls.py index cd7918d..7a19a14 100644 --- a/studysite/urls.py +++ b/studysite/urls.py @@ -29,4 +29,5 @@ path('courses/', views.CoursesView.as_view(), name='course-finder'), path('courses/add/', views.addcourse, name="course-add"), path('courses///', views.addCourseToUser, name='course-add-user'), + path('users/', views.UsersView.as_view(), name='user-view') ] diff --git a/studysite/views.py b/studysite/views.py index 9ab59bf..0f9cbc4 100644 --- a/studysite/views.py +++ b/studysite/views.py @@ -53,6 +53,19 @@ class CoursesView(generic.ListView): def get_queryset(self): return Course.objects.order_by('course_subject') + +class UsersView(generic.ListView): + model = User + template_name = 'studysite/users.html' + context_object_name = 'user_list' + + # def get_context_data(self, **kwargs): + # context = super(UsersView, self).get_context_data(**kwargs) + # context['object_list'] = UserProfile.objects.all() + # return context + + def get_queryset(self): + return UserProfile.objects.all() # def addCourseToUser(request, self.pk, self): # print("test")