我正在尝试为 django 阅读本教程https://docs.djangoproject.com/en/dev/intro/tutorial01/,我可以进入第 2 部分的开头,然后一步一步地遵循它,当我转到 /admin/ 站点,它会产生与正常 localhost:8000 站点完全相同的输出。知道为什么会发生这种情况吗?提前感谢您的帮助。
编辑:我的 urls.py 文件被完全注释掉了。在取消注释标记为启用管理页面、重新运行 django 服务器并在浏览器中打开 /admin/ 页面的部分后,我收到以下错误:
NameError at /admin/
name 'admin' is not defined
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.5.1
Exception Type: NameError
Exception Value:
name 'admin' is not defined
Exception Location: /home/<username>/Django Test/mysite/mysite/urls.py in <module>, line 16
Python Executable: /usr/bin/python
Python Version: 2.7.4
Python Path:
['/home/jgreen/Django Test/mysite',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-i386-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
'/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
'/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
服务器时间:2013年6月11日星期二16:47:13 -0500