Admin Page Error

329 views
Skip to first unread message

Daniel Pek

unread,
Nov 13, 2014, 10:15:21 PM11/13/14
to django...@googlegroups.com
Hi, 

I'm new to Django, and I've been following the tutorial up until the 2nd part where it asks your to runserver, and then access the admin page. However, when i try to access 127.0.0.1:8000/admin/ i get this error:

Here is the traceback:

Environment:


Request Method: GET

Django Version: 1.7.1
Python Version: 2.7.8
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'polls')
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')


Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Library/Python/2.7/site-packages/django/contrib/admin/sites.py" in wrapper
  225.                 return self.admin_view(view, cacheable)(*args, **kwargs)
File "/Library/Python/2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  105.                     response = view_func(request, *args, **kwargs)
File "/Library/Python/2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  52.         response = view_func(request, *args, **kwargs)
File "/Library/Python/2.7/site-packages/django/contrib/admin/sites.py" in inner
  199.                 from django.contrib.auth.views import redirect_to_login
File "/Library/Python/2.7/site-packages/django/contrib/auth/views.py" in <module>
  8. from django.shortcuts import resolve_url

Exception Type: ImportError at /admin/
Exception Value: cannot import name resolve_url

and the error on the browser is:

ImportError at /admin/

cannot import name resolve_url
Request Method:GET
Request URL:http://127.0.0.1:8000/admin/
Django Version:1.7.1
Exception Type:ImportError
Exception Value:
cannot import name resolve_url
Exception Location:/Library/Python/2.7/site-packages/django/contrib/auth/views.py in <module>, line 8
Python Executable:/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python Version:2.7.8
Python Path:
['/Users/___/Documents/projects/speakeasy',
 '/Library/Python/2.7/site-packages/pip-1.5.1-py2.7.egg',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
 '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages',
 '/Library/Python/2.7/site-packages',
 '/Library/Python/2.7/site-packages/PIL']
Server time:Fri, 14 Nov 2014 14:09:33 +1100

I dont know what is wrong? I think it might be a pathing problem with Python but im not entirely sure, any help would be awesome, thanks



Collin Anderson

unread,
Nov 17, 2014, 4:03:34 PM11/17/14
to django...@googlegroups.com
Hello,

Try completely uninstalling and reinstalling django.

The shortcuts module was changed from django/shortcuts/__init__.py to django/shortcuts.py, and I bet this error is related to that.

Collin
Reply all
Reply to author
Forward
0 new messages