title: Django Runserver ImportError: No module named models
body: <p>When I run Django App I get the following error:</p>
  
  <pre><code>Unhandled exception in thread started by &lt;function wrapper at 0x7f8449a387d0&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 116, in inner_run
      self.check(display_num_errors=True)
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
      include_deployment_checks=include_deployment_checks,
    File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
      new_errors = check(app_configs=app_configs)
    File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 13, in check_url_config
      return check_resolver(resolver)
    File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 23, in check_resolver
      for pattern in resolver.url_patterns:
    File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, 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 33, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, 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 "/root/soho-website/backend/project/urls.py", line 10, in &lt;module&gt;
      url(r'', include('web.urls')),
    File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 52, in include
      urlconf_module = import_module(urlconf_module)
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
      __import__(name)
    File "/root/soho-website/backend/web/urls.py", line 6, in &lt;module&gt;
      from web import views, models
    File "/root/soho-website/backend/web/views.py", line 19, in &lt;module&gt;
      from captcha.models import CaptchaStore
  ImportError: No module named models
  </code></pre>
  
  <p>But, If I comment the following line in my urls.py file: <code>url(r'', include('web.urls')),</code> where I define my Index Page, my App Works.</p>
  
  <p>I have correctly installed all my Apps via Pip (Captcha, Ckeditor, MySQL, etc)</p>
  
  <p><strong>Details:</strong></p>
  
  <ul>
  <li>My project name: <strong>project</strong></li>
  <li>Django version: <strong>1.9.5</strong></li>
  <li>Python version: <strong>2.7.6 [GCC 4.8.2] on linux2</strong></li>
  </ul>
  
  <p><strong>urls.py File</strong></p>
  
  <pre><code>from django.conf.urls import patterns, include, url
  from django.contrib import admin
  
  urlpatterns = patterns('',
      # Examples:
      # url(r'^$', 'project.views.home', name='home'),
      # url(r'^blog/', include('blog.urls')),
  
      # Website URLs
      url(r'', include('web.urls')),
  
      # Admin URLs
      url(r'^admin/', include(admin.site.urls)),
  )
  </code></pre>
  
  <p>base.py file (some config):</p>
  
  <pre><code>import os
  from django.core.urlresolvers import set_urlconf
  
  BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  ROOT_URLCONF = 'project.urls'
  
  WSGI_APPLICATION = 'project.wsgi.application'
  
  DOMAIN_URL = "http://MY_IP"
  </code></pre>
  
  <p>The structure of my application is:</p>
  
  <p><a href="https://i.stack.imgur.com/AG8nd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AG8nd.png" alt="enter image description here"></a></p>
  
  <p>What is wrong with my config?</p>
  
  <h2>UPDATE</h2>
  
  <p>I have correctly installed Captcha with PIP INSTALL. In my Installed_APPS I defined captcha and if I add the follow line: <code>url(r'^captcha/', include('captcha.urls')),</code> in my urls.py file the error persist.</p>
  
  <p>This is my web/views.py:</p>
  
  <pre><code>#!/usr/bin/python
  # -*- coding: utf-8 -*-
  # Python imports
  import datetime
  import json
  
  # Django imports
  from django.shortcuts import render, get_object_or_404
  from django.views.generic import View, ListView, DetailView, YearArchiveView, \
      MonthArchiveView, TemplateView, FormView
  from django.http import Http404, HttpResponse
  from django.template import loader, Context
  from django.core.mail import EmailMultiAlternatives
  from django.db.models import Q
  from django.conf import settings
  
  
  # Captcha imports
  from captcha.models import CaptchaStore # This is the line where error occurs
  from captcha.helpers import captcha_image_url
  
  # APP imports.
  from web.models import Slider, Woman, Article, CategoryArticle, CategoryWoman, \
      CategoryBlog, Blog, Banner
  from web.constans import MONTHS
  from web.utils import women_dates_list
  from web.forms import ContactForm, RegisterForm, ContactModelForm
  </code></pre>
  
  <p>Sorry for my english.</p>
  
  <h2>UPDATE 2</h2>
  
  <p>Error with Django-Ckeditor</p>
  
  <pre><code>Unhandled exception in thread started by &lt;function wrapper at 0x7fe211911140&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 116, in inner_run
      self.check(display_num_errors=True)
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
      include_deployment_checks=include_deployment_checks,
    File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
      new_errors = check(app_configs=app_configs)
    File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 13, in check_url_config
      return check_resolver(resolver)
    File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 23, in check_resolver
      for pattern in resolver.url_patterns:
    File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, 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 33, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, 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 "/root/soho-website/backend/project/urls.py", line 10, in &lt;module&gt;
      url(r'', include('web.urls')),
    File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 52, in include
      urlconf_module = import_module(urlconf_module)
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
      __import__(name)
    File "/root/soho-website/backend/web/urls.py", line 83, in &lt;module&gt;
      (r'^ckeditor/', include('ckeditor.urls')),
    File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 52, in include
      urlconf_module = import_module(urlconf_module)
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
      __import__(name)
  ImportError: No module named urls
  </code></pre>
  
  <p>And this is my web/urls.py</p>
  
  <pre><code># Django imports
  from django.conf.urls import patterns, include, url
  from django.conf import settings
  
  # App imports
  from web import views, models
  
  
  # URLs
  urlpatterns = patterns('',
    ##
    ## URLS of the Website
    ##
    # CAPTCHA
      url(r'^captcha/', include('captcha.urls')),
  
    # CKEDITOR
      (r'^ckeditor/', include('ckeditor.urls')),
  )
  </code></pre>