Traceback:
Environment:
Request Method: GET
Request URL: http://67.205.177.49/
Django Version: 1.8.7
Python Version: 2.7.12
Installed Applications:
('polls',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')
Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
119. resolver_match = resolver.resolve(request.path_info)
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
365. for pattern in self.url_patterns:
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in url_patterns
401. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in urlconf_module
395. self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/__init__.py" in import_module
37. __import__(name)
File "/usr/lib/python2.7/dist-packages/gevent/builtins.py" in __import__
93. result = _import(*args, **kwargs)
File "/home/django/django_project/django_project/urls.py" in <module>
20. url(r'^', include('polls.urls')),
File "/usr/lib/python2.7/dist-packages/django/conf/urls/__init__.py" in include
33. urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/__init__.py" in import_module
37. __import__(name)
File "/usr/lib/python2.7/dist-packages/gevent/builtins.py" in __import__
93. result = _import(*args, **kwargs)
File "/home/django/django_project/polls/urls.py" in <module>
3. from . import views
File "/usr/lib/python2.7/dist-packages/gevent/builtins.py" in __import__
93. result = _import(*args, **kwargs)
File "/home/django/django_project/polls/views.py" in <module>
6. from django.urls import reverse
File "/usr/lib/python2.7/dist-packages/gevent/builtins.py" 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/urls.py 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(admin.site.urls)),
]
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 settings.py. Also, if I run it locally in development everything works fine.
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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.