Data List on the web page 본문
728x90
1. views.py
from django.shortcuts import render
from second_app.models import Topic, Webpage, AccessRecord
# Create your views here.
def index(request):
webpages_list = AccessRecord.objects.order_by('date')
date_dict = {'access_records': webpages_list}
return render(request, 'second_app/index.html', context=date_dict)
2. index.html
3. mystyle.css
h1{
color: red;
}
table,th,td{
border: 5px solid black;
}
'개발 > Django' 카테고리의 다른 글
Templates - Relative URLs+ Inheritance + Filter (0) | 2020.05.07 |
---|---|
장고 공부법 (0) | 2020.05.07 |
Models - Templates - Views (MTV) (0) | 2020.05.05 |
Population Scripts (0) | 2020.05.05 |
Models (0) | 2020.05.05 |
Comments