title: Django First Tutorial: ImportError: No module named 'polls'
body: <p>I've set up Django on my Windows 10 PC, and was working through the first tutorial: <a href="https://docs.djangoproject.com/en/1.9/intro/tutorial01/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/1.9/intro/tutorial01/</a></p>
  
  <p>I can't seem to do the first part, because of an import error.</p>
  
  <p>Here's the views.py script:</p>
  
  <pre><code>mysite/polls/views.py
  
  from django.shortcuts import render
  from django.http import HttpResponse
  
  # Create your views here.
  
  def index(request):
      return HttpResponse("Hello, world. You're at the polls index.") 
  </code></pre>
  
  <p>urls.py in the polls app:</p>
  
  <pre><code>mysite/polls/urls.py
  
  from django.conf.urls import url
  import views
  
  urlpatterns = [
      url(r'^$', views.index, name='index'),
  ]
  </code></pre>
  
  <p>And urls.py in mysite:</p>
  
  <pre><code>mysite/mysite/urls.py
  
  from django.conf.urls import include, url
  from django.contrib import admin
  
  urlpatterns = [
      url(r'^polls/', include('polls.urls')),
      url(r'^admin/', admin.site.urls),
  ]
  </code></pre>
  
  <p>After troubleshooting and fixing issues with the first two files, this is the error I get when I run "python urls.py" on the mysite urls.py file:</p>
  
  <p><a href="https://i.stack.imgur.com/eJKU2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eJKU2.png" alt="enter image description here"></a>        </p>
  
  <p>I've seen a few stackoverflow posts here regarding this tutorial, and similar issues. Someone advocated that I add polls to the INSTALLED_APPS section of settings.py, but this did not work.</p>
  
  <pre><code>/mysite/mysite/settings.py
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'polls',
  ]
  </code></pre>
  
  <p>I also read that someone got this to work by adding the 'polls' module to their pythonpath... But I'm not sure if this is the way to go.</p>
  
  <p>A very similar post was made here: <a href="https://stackoverflow.com/questions/32785902/django-reusable-apps-tutorial-importerror-no-module-named-polls">Django reusable apps tutorial, ImportError: No module named &#39;polls&#39;</a>
  but no solution was provided.</p>
  
  <p>Anyone with some insight or input, please let me know what I can do to fix this, and let me know if you need any more information.</p>