<s> from django . shortcuts import render_to_response , get_object_or_404 <EOL> from django . template . context import RequestContext <EOL> from django . views . decorators . csrf import csrf_protect <EOL> from . models import Message <EOL> def home ( request ) : <EOL> context = { <EOL> '<STR_LIT>' : Message . objects . all ( ) , <EOL> } <EOL> return render_to_response ( '<STR_LIT>' , context , context_instance = RequestContext ( request ) ) <EOL> @ csrf_protect <EOL> def message ( request , id ) : <EOL> context = { <EOL> '<STR_LIT:message>' : get_object_or_404 ( Message , pk = id ) , <EOL> } <EOL> return render_to_response ( '<STR_LIT>' , context , context_instance = RequestContext ( request ) ) </s>
