From 4c5a9d9807065fcfb3e826c78d9010612b6caf65 Mon Sep 17 00:00:00 2001 From: Nolan Brubaker Date: Sat, 12 Mar 2011 22:48:02 -0500 Subject: [PATCH] Added default view/template, with matching URLconf Default template is really a dummy for right now, and the view just creates an empty context to pass in. --- TicTacToe/apps/tictactoe/urls.py | 5 +++++ TicTacToe/apps/tictactoe/views.py | 8 +++++++- TicTacToe/templates/tictactoe/game_board.html | 11 +++++++++++ TicTacToe/urls.py | 10 ++-------- 4 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 TicTacToe/apps/tictactoe/urls.py create mode 100644 TicTacToe/templates/tictactoe/game_board.html diff --git a/TicTacToe/apps/tictactoe/urls.py b/TicTacToe/apps/tictactoe/urls.py new file mode 100644 index 000000000..283f3c7fd --- /dev/null +++ b/TicTacToe/apps/tictactoe/urls.py @@ -0,0 +1,5 @@ +from django.conf.urls.defaults import * + +urlpatterns = patterns('TicTacToe.apps.tictactoe.views', + url(r'^$', 'game_board', name='game_board') +) diff --git a/TicTacToe/apps/tictactoe/views.py b/TicTacToe/apps/tictactoe/views.py index 60f00ef0e..c7e267458 100644 --- a/TicTacToe/apps/tictactoe/views.py +++ b/TicTacToe/apps/tictactoe/views.py @@ -1 +1,7 @@ -# Create your views here. +from django.template import RequestContext +from django.shortcuts import render_to_response + +def game_board(request): + context = RequestContext(request,{}) + return render_to_response('tictactoe/game_board.html', context) + diff --git a/TicTacToe/templates/tictactoe/game_board.html b/TicTacToe/templates/tictactoe/game_board.html new file mode 100644 index 000000000..254bf34cc --- /dev/null +++ b/TicTacToe/templates/tictactoe/game_board.html @@ -0,0 +1,11 @@ + + + + + + +Hello! + + + + diff --git a/TicTacToe/urls.py b/TicTacToe/urls.py index 05173c6af..fde8f4569 100644 --- a/TicTacToe/urls.py +++ b/TicTacToe/urls.py @@ -1,16 +1,10 @@ from django.conf.urls.defaults import * + # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', - # Example: - # (r'^TicTacToe/', include('TicTacToe.foo.urls')), - - # Uncomment the admin/doc line below to enable admin documentation: - # (r'^admin/doc/', include('django.contrib.admindocs.urls')), - - # Uncomment the next line to enable the admin: - # (r'^admin/', include(admin.site.urls)), + (r'^$', include('TicTacToe.apps.tictactoe.urls')), )