Howdy Mike,

> def current_datetime(request):
>         now = datetime.datetime.now()
>         html = "<html><body>It is now %s.</body></html>" % now
>         return HttpResponse(html)
>
> - then edit your urls.py to contain
>
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
>         (r'^now/$', current_datetime),

You just need to let Django know about the module that contains the
current_datetime function.

For example, if your project name is "myproject" and your app name is
"myapp", you would do this:

urlpatterns = patterns('myproject.myapp.views',
        (r'^now/$', current_datetime),
)

--gordy


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to