We've now got a sane template structure. webtemplates/base.html is the parent of all pages. index.html in that directory is the default page, and sub-directories from there will hold the templates for various applications. Notice how in index.html and the file in the news directory are put together. It's really simple, see the Template documentation on djangoproject.com for more in-depth details.

This commit is contained in:
Greg Taylor 2007-07-26 13:52:46 +00:00
parent a3ac4ff17c
commit 1afcd6bf99
5 changed files with 147 additions and 188 deletions

View file

@ -15,8 +15,8 @@ def show_news(request, entry_id):
#news_entries = NewsEntry.objects.all().order_by('-date_posted')[:10]
pagevars = {
"page_title": "Front Page",
"page_title": "News Entry",
}
context_instance = RequestContext(request)
return render_to_response('base.html', pagevars, context_instance)
return render_to_response('news/show_entry.html', pagevars, context_instance)

View file

@ -27,6 +27,7 @@ def page_index(request):
pagevars = {
"page_title": "Front Page",
"no_sidebar": True,
"news_entries": news_entries,
"players_connected_recent": recent_players,
"num_players_connected": functions_db.get_connected_players().count(),