File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 11from django .conf .urls .defaults import *
2- from mysite .views import hello
2+ from mysite .views import hello , current_datetime
33
44# Uncomment the next two lines to enable the admin:
55# from django.contrib import admin
1010 # url(r'^$', 'mysite.views.home', name='home'),
1111 # url(r'^mysite/', include('mysite.foo.urls')),
1212 url ('^hello/$' , hello ),
13+ url ('^time/$' , current_datetime ),
1314 # Uncomment the admin/doc line below to enable admin documentation:
1415 # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
1516
Original file line number Diff line number Diff line change 11from django .http import HttpResponse
2+ import datetime
23
34def hello (request ):
45 return HttpResponse ("Hello World" )
6+
7+ def current_datetime (request ):
8+ now = datetime .datetime .now ()
9+ html = "<html><body>It is now %s.</body></html>" % now
10+ return HttpResponse (html )
You can’t perform that action at this time.
0 commit comments