File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 33{% block title %}Home | {% endblock %}
44
55{% block content %}
6- < h1 > Welcome to home page</ h1 >
6+ < div class ="row ">
7+ < div class ="col-md-6 col-12 mx-md-auto mx-3 mt-5 md-5 ">
8+ < h1 class ="fw-bolder "> shahriaarrr Blog</ h1 >
9+ < h5 class ="text-muted "> Write about everything that i liked</ h5 >
10+ </ div >
11+ </ div >
712{% endblock %}
Original file line number Diff line number Diff line change 11from django .shortcuts import render
22from django .views import View
3+ from django .views .generic import ListView
4+
5+ from .models import Article
36# Create your views here.
47
5- class Index (View ):
6- def get (self , request ):
7- return render (request , 'blog/home.html' )
8+ class Index (ListView ):
9+ model = Article
10+ queryset = Article .objects .all ().order_by ("-date" )
11+ template_name = 'blog/home.html'
812
913
1014class About (View ):
You can’t perform that action at this time.
0 commit comments