Commit bc58a526 authored by justin's avatar justin

feat: shifted to using HTML templates for dashboard view

parent 7537a392
{% extends 'base.html' %}
{% block content %}
<h1>Welcome to Widget!</h1>
<h2>Widget Users:</h2>
<ul>
{% for user in users %}
<a href="">
<li>{{ user.last_name }}, {{ user.first_name }}</li>
</a>
{% endfor %}
</ul>
{% endblock %}
from django.http import HttpResponse
from .models import Department, WidgetUser
# from django.http import HttpResponse
from .models import WidgetUser
from django.shortcuts import render
def dashboard(request):
content = "Welcome to Widget! <br><br> WIDGET USERS: <br>"
# content = "Welcome to Widget! <br><br> WIDGET USERS: <br>"
# users = WidgetUser.objects.all()
#
# for user in users:
# content += str(user) + ": " + str(user.department) + "<br>"
#
# return HttpResponse(content)
users = WidgetUser.objects.all()
for user in users:
content += str(user) + ": " + str(user.department) + "<br>"
return HttpResponse(content)
context = {"users": users}
return render(request, "dashboard/dashboard.html", context)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment