First Commit
This commit is contained in:
commit
ce0758fbbb
496 changed files with 52062 additions and 0 deletions
16
home/views.py
Executable file
16
home/views.py
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
from django.shortcuts import render
|
||||
from posts.models import Post
|
||||
|
||||
def home(request):
|
||||
edito = Post.objects.filter(type='edito', active=True).first()
|
||||
news = Post.objects.filter(type='news', active=True).order_by('-created')[:6]
|
||||
|
||||
context = {
|
||||
'edito': edito,
|
||||
'news': news,
|
||||
}
|
||||
|
||||
return render(request, "home.html", context)
|
||||
|
||||
def custom_404(request, exception):
|
||||
return render(request, "errors/404.html", status=404)
|
||||
Loading…
Add table
Add a link
Reference in a new issue