求解答 说是找不到'hello', 我看Python的搜索path 也对啊 附件是程序 我是第一次接触Django

38 views
Skip to first unread message

zhoumin...@gmail.com

unread,
Nov 9, 2014, 10:29:58 AM11/9/14
to django...@googlegroups.com

NameError at /

name 'hello' is not defined
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.7.1
Exception Type: NameError
Exception Value:
name 'hello' is not defined
Exception Location: E:\djcode\mysite\mysite\urls.py in <module>, line 5
Python Executable: C:\Python27\python.exe
Python Version: 2.7.6
Python Path:
['E:\\djcode\\mysite',
 'C:\\Python27\\lib\\site-packages\\setuptools-1.1.4-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\swampy-2.1.7-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django-1.7.1-py2.7.egg',
 'C:\\windows\\system32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Python27\\lib\\site-packages']
views.py
urls.py
Message has been deleted

tkdchen

unread,
Nov 11, 2014, 8:54:05 AM11/11/14
to django...@googlegroups.com
这不是Django的问题。你先把Python搞明白。

Ricardo L. Dani

unread,
Nov 11, 2014, 10:09:17 AM11/11/14
to django...@googlegroups.com
missing

from .views import hello

on urls.py

or use 'hello' as string

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8cf2f5d7-2906-4dad-88ab-0d6bd290008c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
[]`s
Ricardo L. Dani

Ricardo L. Dani

unread,
Nov 11, 2014, 10:09:22 AM11/11/14
to django...@googlegroups.com
actually, or use 'mysite.viess.hello' on the second argument of your url definition
Reply all
Reply to author
Forward
0 new messages