No module named URLs


Request Method: GET
Request URL:

Django Version: 1.8.7
Python Version: 2.7.12
Installed Applications:
Installed Middleware:

File "/usr/lib/python2.7/dist-packages/django/core/handlers/" in get_response
  119.                 resolver_match = resolver.resolve(request.path_info)
File "/usr/lib/python2.7/dist-packages/django/core/" in resolve
  365.             for pattern in self.url_patterns:
File "/usr/lib/python2.7/dist-packages/django/core/" in url_patterns
  401.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/lib/python2.7/dist-packages/django/core/" in urlconf_module
  395.             self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/" in import_module
  37.     __import__(name)
File "/usr/lib/python2.7/dist-packages/gevent/" in __import__
  93.             result = _import(*args, **kwargs)
File "/home/django/django_project/django_project/" in <module>
  20.     url(r'^', include('polls.urls')),
File "/usr/lib/python2.7/dist-packages/django/conf/urls/" in include
  33.         urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/" in import_module
  37.     __import__(name)
File "/usr/lib/python2.7/dist-packages/gevent/" in __import__
  93.             result = _import(*args, **kwargs)
File "/home/django/django_project/polls/" in <module>
  3. from . import views
File "/usr/lib/python2.7/dist-packages/gevent/" in __import__
  93.             result = _import(*args, **kwargs)
File "/home/django/django_project/polls/" in <module>
  6. from django.urls import reverse
File "/usr/lib/python2.7/dist-packages/gevent/" in __import__
  93.             result = _import(*args, **kwargs)

Exception Type: ImportError at /
Exception Value: No module named urls

The very confusing part is that I can change the home/django/django_project/ file to this:

from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
    #url(r'^', include('polls.urls')),
    url(r'^admin/', include(,

With my apps url file commented out and it will load the default django page, so the server seems to be working but breaks when I include my app. It is properly installed in Also, if I run it locally in development everything works fine.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


Are you following the getting started tutorial here? if no try to follow it and see if the problem still persists

Also one more thing the first url pattern should be url(r'^polls/', include('polls.urls')), not url(r'^', include('polls.urls')),

hope this helps