Finished Views for Dashboard

parent 126f3afe
from django.shortcuts import render
from django.http import HttpResponse
from .models import WidgetUser, Department
def index(request):
text_in_http = "Welcome to Widget! <br> <br> WIDGET USERS: <br> <ul>"
for user in WidgetUser.objects.all():
text_in_http += "<li>{}, {} {} : {}</li>".format(user.last_name, user.first_name,
user.middle_name, user.department
)
text_in_http += "</ul>"
html_string = '<html><body>{}</body></html>'.format(text_in_http)
return HttpResponse(html_string)
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