Django/モデルデータ一覧表示

//myapp/bbs/views.py
from django.shortcuts import render
from django.http import HttpResponse
from .models import Article

def index(request):
    articles = Article.objects.all()
    context = {
        'message': 'Welcome my BBS',
        'articles': articles,
    }
    return render(request, 'bbs/index.html', context)
    

//myapp/bbs/templates/bbs/index.html

!DOCTYPE html>
html>
    head>
        meta charset='utf-8'>
        title>bbs/title>
    /head>
    body>
        h1>bbs/h1>
        p>{{ message }}/p>
        {% for article in articles %}
            p>{{ article.content }}/p>
        {% endfor %}
    /body>
/html>


python manage.py runserver

//ブラウザ
http://localhost:8000/bbs