title: 'str' object is not callable,how to deal?
body: <p>When I run my Python Django app, I receive an error: </p>
  
  <blockquote>
    <p>'str' object is not callable  </p>
  </blockquote>
  
  <p>I've tried the solutions here: <a href="https://stackoverflow.com/questions/6039605/typeerror-str-object-is-not-callable-python">TypeError: &#39;str&#39; object is not callable (Python)</a>, but they don't work for me. I'm trying to run the Django book sample:</p>
  
  <p><strong>view.py:</strong>  </p>
  
  <pre><code># Create your views here.
  from django.http import HttpResponse
  import datetime
  
  def current_time(request):
      now = datetime.datetime.now()
      html = "&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;%s&lt;/body&gt;&lt;/html&gt;" % str(now)
      return HttpResponse(html)
  
  def hello(request,name):
      return HttpResponse("Hello django")
  
  def what(request):
      return HttpResponse("what's the problem django?")
  </code></pre>
  
  <p><strong>urls.py:</strong></p>
  
  <pre><code>from django.conf.urls import patterns, include, url
  from hello_django.views import current_time,hello,what
  
  
  urlpatterns = patterns('',
      url(r'^time/$','current_time'),
      url(r'^what/$','what'),
      url(r'^hello/([a-zA-Z0-9]+)','hello'),
  )
  </code></pre>
  
  <p>This is the URL I'm trying: <code>http://127.0.0.1:8000/what/</code>.</p>
  
  <p><strong>Stack Trace:</strong></p>
  
  <pre><code>TypeError at /what/
  'str' object is not callable
  Request Method: GET
  Request URL:    http://127.0.0.1:8000/what/
  Django Version: 1.5.1
  Exception Type: TypeError
  Exception Value:    
  'str' object is not callable
  Exception Location: C:\Python27\lib\site-packages\django\core\handlers\base.py in get_response, line 115
  Python Executable:  C:\Python27\python.exe
  Python Version: 2.7.4
  Python Path:    
  ['D:\\Developer Center\\PyCharm\\helloDjango',
   'C:\\Python27\\lib\\site-packages\\pip-1.3.1-py2.7.egg',
   'C:\\Python27\\lib\\site-packages\\mysql_python-1.2.4-py2.7-win32.egg',
   'D:\\Developer Center\\PyCharm\\helloDjango',
   'C:\\Windows\\SYSTEM32\\python27.zip',
   'C:\\Python27\\DLLs',
   'C:\\Python27\\lib',
   'C:\\Python27\\lib\\plat-win',
   'C:\\Python27\\lib\\lib-tk',
   'C:\\Python27',
   'C:\\Python27\\lib\\site-packages',
   'C:\\Python27\\lib\\site-packages\\PIL']
  Server time:    Tue, 7 Jan 2014 11:44:30 +0330
  Traceback Switch to copy-and-paste view
  
  C:\Python27\lib\site-packages\django\core\handlers\base.py in get_response
                          response = callback(request, *callback_args, **callback_kwargs) ...
  ▶ Local vars
  </code></pre>