Opened 15 years ago

Closed 15 years ago

#12330 closed (invalid)

Tutorials Page 2 missing 'from django.contrib import admin' in urls.py

Reported by: dummydata Owned by: nobody
Component: Uncategorized Version: 1.1
Severity: Keywords: tutorial admin
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the tutorial section that details enabling the admin console, the instructions as they are result in an HTTP 500 error (see full error below) when attempting access the admin URL.

Adding 'from django.contrib import admin' to 'mysite/urls.py' and restarting the test web server solved the issue. The import statement should be added or clarified in the tutorial.


-- ERROR --

Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/[[BR]]
Django Version: 1.1.1
Python Version: 2.6.4
Installed Applications:
['django.contrib.auth',

'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'inventory.collection']


Installed Middleware:
('django.middleware.common.CommonMiddleware',

'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')



Traceback:
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response

  1. request.path_info)

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/urlresolvers.py" in resolve

  1. for pattern in self.url_patterns:

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/urlresolvers.py" in _get_url_patterns

  1. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/urlresolvers.py" in _get_urlconf_module

  1. self._urlconf_module = import_module(self.urlconf_name)

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/utils/importlib.py" in import_module

  1. import(name)

File "/Users/dru/projects/inventory/../inventory/urls.py" in <module>

  1. (r'admin/', include(admin.site.urls)),


Exception Type: NameError at /admin/
Exception Value: name 'admin' is not defined

Change History (1)

comment:1 by dummydata, 15 years ago

Resolution: invalid
Status: newclosed

nevermind... stupid user should RTFM. sorry for the noise

Note: See TracTickets for help on using tickets.
Back to Top