demo-hackernews-with-django.../app/web/views.py

12 lines
257 B
Python
Raw Normal View History

2021-06-22 15:43:26 +02:00
from django.shortcuts import render
from app.api.models import News
def home(request):
return render(request, 'pages/list.html', {
'news': News.objects.all()
})
def add_news(request):
return render(request, 'pages/add-news.html', {})