Permalink
Browse files

Modified version for get time template

  • Loading branch information...
1 parent 16759c9 commit 6ed9e4ddef17f9c9ac5de4c26bb861cb380e3291 @mysteryjeans committed Sep 16, 2012
Showing with 3 additions and 15 deletions.
  1. +0 −12 django_ajax/templates/gettime.html
  2. +1 −1 django_ajax/templates/index.html
  3. +2 −2 django_ajax/views.py
@@ -1,12 +0,0 @@
-<html>
- <head>
- <title>Get Time | Django Unobtrusive Ajax</title>
- </head>
- <body>
- <h1>Django Unobtrusive Ajax</h1>
- <h2>Get Time</h2>
- <div>
- Currently it is: {{ time }}
- </div>
- </body>
-</html>
@@ -14,7 +14,7 @@
<input type="submit" value="Get time through ajax"/>
</form>
<h3>Server Time</h3>
- <div id="divTime"></div>
+ <div id="divTime">{{ time }}</div>
</body>
</html>
View
@@ -10,7 +10,7 @@ def home(request):
def gettime(request):
if request.is_ajax():
- return HttpResponse('<div>' + str(datetime.now()) +'</div>')
+ return HttpResponse(str(datetime.now()))
# Graceful degradation
- return render_to_response('gettime.html', {'time': str(datetime.now()) })
+ return render_to_response('index.html', {'time': str(datetime.now()) })

0 comments on commit 6ed9e4d

Please sign in to comment.