Reputation: 39
I'm trying to build my first django server, and something is going wrong with getting the server running.
I try running:
~/Documents/Coding Projects/rssReader/rssreader$ python manage.py runserver
and it returns the following:
Performing system checks...
Unhandled exception in thread started by <function wrapper at 0x7fd2e88c98c0>
Traceback (most recent call last):
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 124, in inner_run
self.check(display_num_errors=True)
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 256, in check
for pattern in self.url_patterns:
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 407, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/kevin/Documents/Coding Projects/rssReader/env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 400, 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/kevin/Documents/Coding Projects/rssReader/rssreader/rssreader/urls.py", line 17, in <module>
from django.urls import path, include
ImportError: cannot import name path
rssreader/urls.py contains the following:
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('rss/', include('rss.urls'))
]
Any help would be very much appreciated, I'm totally new to django. Thanks!
Upvotes: 1
Views: 1601
Reputation: 1736
You have installed a Django version that doesn't have path
inside django/urls/__init__.py
. If you used pip
to install Django, check your version with pip show django
and then run pip install --upgrade Django
.
Otherwise, find a way to install a recent Django using your package installer (anaconda, apt, etc...)
Upvotes: 1