Getting TypeError when I am trying to run server using Django?
<p>I found questions which were close to the question asked by me, but the solutions I found there were not useful to me. Using django version 1.10.1</p>

<p>Output to </p>

<blockquote>
  <p>python manage.py runserver</p>
</blockquote>

<pre><code>Performing system checks...

Unhandled exception in thread started by &lt;function wrapper at 0xb6838064&gt;
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 121, in inner_run
    self.check(display_num_errors=True)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 374, in check
    include_deployment_checks=include_deployment_checks,
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 361, in _run_checks
    return checks.run_checks(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 24, in check_resolver
    for pattern in resolver.url_patterns:
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 313, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 306, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/sidgupta234/Desktop/Hack/guide/guide/urls.py", line 21, in &lt;module&gt;
    url(r'^$', "hacko.views.home", name='home'),
  File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 85, in url
    raise TypeError('view must be a callable or a list/tuple in the case of include().')
TypeError: view must be a callable or a list/tuple in the case of include().
</code></pre>

<p>urls.py file </p>

<pre><code>from django.conf.urls import url
from django.contrib import admin

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', "hacko.views.home", name='home'),
    url(r'^index/$', "hacko.views.index", name='index'),
]
</code></pre>

<p>views.py file</p>

<pre><code>from django.shortcuts import render
import requests
from django.http import HttpResponse
import unicodedata
# Create your views here.
def home(request):

    return render(request,"sample.html");

def index(request):
     print "i was called"
     if(request.GET.get('q', '')):
        theUrl="http://en.wikipedia.org/w/api.php?action=query&amp;prop=extracts&amp;format=json&amp;titles="+request.GET.get('q', '')
        r = requests.get(theUrl, auth=('user', 'pass'));
        print r.text
        return HttpResponse(r.text, content_type='hacko/json')
     elif(request.GET.get('p', '')):
        theUrl="https://en.wikipedia.org/w/api.php?action=query&amp;prop=extracts&amp;format=json&amp;exintro=&amp;titles="+request.GET.get('p', '')
        r = requests.get(theUrl, auth=('user', 'pass'));
        print r.text
        return HttpResponse(r.text, content_type='hacko/json')
     else:
        key="f7ee811c-3f3d-47b4-ad77-b31fe1831b2f"
        r="http://www.dictionaryapi.com/api/v1/references/thesaurus/xml/"+request.GET.get('r', '')+"?key="+key
        r=requests.get(r);
        r=r.text
        r=unicodedata.normalize('NFKD', r).encode('ascii','ignore')
        return HttpResponse(r,content_type="text/plain")
</code></pre>

<p>In 1.10, you can no longer pass import paths to url(), you need to pass the actual view function:</p>

<pre><code>from django.conf.urls import url
from django.contrib import admin
from hacko import views
urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', views.home, name='home'),
    url(r'^index/$', views.index, name='index'),
]
</code></pre>

python django