You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

14 lines
357 B

from django.shortcuts import render
from django.http import HttpResponse
from .models import Article
def index(request):
articles = Article.objects.order_by('-date')
s = ("Bonjour et bienvenue"
" sur mon super site trop cool"
"\nMes articles :"
)
for a in articles:
s += a.title + "\n"
return HttpResponse(s)