from django.shortcuts import render
post = [
{
'author': 'CoreyMS',
'title': 'Blog Post',
'content': 'First Post Content',
'date_posted': 'August 27, 2018'
},
{
'author': 'Jane Doe',
'title': 'Blog Post 2',
'content': 'Second Post Content',
'date_posted': 'August 28, 2018'
}
]
def home(request):
context = {
'post': post
}
return render(request, 'blog/home.html', context)
def about(request):
return render(request, 'blog/about.html')
My urls.py:
from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='blog-home'),
path('about/', views.about, name='blog-about'),
]