出错信息:
NameError at /admin/
name ‘admin’ is not defined
| Request Method: | GET |
|---|---|
| Request URL: | http://127.0.0.1:8000/admin/ |
| Django Version: | 1.4 |
| Exception Type: | NameError |
| Exception Value: | name ‘admin’ is not defined |
| Exception Location: | in <module>, line 19 |
| Python Executable: | C:\Python27\python.exe |
| Python Version: | 2.7.0 |
| Python Path: | [‘C:\Documents and Settings\netcat\\xd7\xc0\xc3\xe6\Django-1.4\Django-1.4\django\bin\blog’, |
| Server time: | Wed, 18 Apr 2012 23:18:20 +0800 |
解决方法:
在urls.py文件中添加一行
from django.contrib import admin