On Sun, May 2, 2010 at 11:16 PM, kelp <kelp...@gmail.com> wrote: > Yes, I did that, but for some reason, it is still not working, here's > the contents of my views.py: > from django.http import HttpResponse > from django.shortcuts import render_to_response > import datetime > > def hello(request): > return HttpResponse("Hello world") > > def search_form(request): > return render_to_response('search_form.html') > > def current_datetime(request): > now = datetime.datetime.now() > html = "<html><body>It is now %s.</body></html>" % now > return HttpResponse(html) > > > > Does order matter when I am importing? > > Order matters in that you must import something before attempting to use it.
As for getting the error you are getting even though views.py has a definition for search_form -- that is a bit of a mystery. Somehow the views.py that has the search_form function defined is not the one that is being used. I assume you are using the development server? It should have re-loaded itself when you changed views.py, so that the new code would be picked up. But you can manually stop and restart it to make sure it is picking up the latest code. Karen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.