demo-hackernews-with-django.../app/web/views.py
Andros Fenollosa a901b8d54a Add API
2021-06-22 15:43:26 +02:00

12 lines
257 B
Python

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', {})