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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

zhoumingxing985

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']

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/80dc76f9-f88e-40e1-a439-acb4fc994417%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

views.py (101 bytes) Download Attachment
urls.py (311 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

tkdchen
这不是Django的问题,你先把Python搞明白。

On Sunday, November 9, 2014 11:29:58 PM UTC+8, [hidden email] wrote:

NameError at /

name 'hello' is not defined
Request Method: GET
Request URL: <a href="http://127.0.0.1:8000/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A8000%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFs1_JFhjr8Z-DCOM1R3AXQ16In5Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A8000%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFs1_JFhjr8Z-DCOM1R3AXQ16In5Q';return true;">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']

On Sunday, November 9, 2014 11:29:58 PM UTC+8, [hidden email] wrote:

NameError at /

name 'hello' is not defined
Request Method: GET
Request URL: <a href="http://127.0.0.1:8000/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A8000%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFs1_JFhjr8Z-DCOM1R3AXQ16In5Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A8000%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFs1_JFhjr8Z-DCOM1R3AXQ16In5Q';return true;">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']

On Sunday, November 9, 2014 11:29:58 PM UTC+8, [hidden email] wrote:

NameError at /

name 'hello' is not defined
Request Method: GET
Request URL: <a href="http://127.0.0.1:8000/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A8000%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFs1_JFhjr8Z-DCOM1R3AXQ16In5Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A8000%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFs1_JFhjr8Z-DCOM1R3AXQ16In5Q';return true;">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']

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/fd4ef940-77b1-4701-8044-ae85cc6b602d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

tkdchen
In reply to this post by zhoumingxing985
这不是Django的问题。你先把Python搞明白。

On Sunday, November 9, 2014 11:29:58 PM UTC+8, [hidden email] wrote:

NameError at /

name 'hello' is not defined
Request Method: GET
Request URL: <a href="http://127.0.0.1:8000/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A8000%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFs1_JFhjr8Z-DCOM1R3AXQ16In5Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2F127.0.0.1%3A8000%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFs1_JFhjr8Z-DCOM1R3AXQ16In5Q';return true;">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']

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

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

ricardodani
missing

from .views import hello

on urls.py

or use 'hello' as string

2014-11-11 11:54 GMT-02:00 tkdchen <[hidden email]>:
这不是Django的问题。你先把Python搞明白。

On Sunday, November 9, 2014 11:29:58 PM UTC+8, [hidden email] wrote:

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']

--
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 [hidden email].
To post to this group, send email to [hidden email].
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAEq3mejPbmcyXb5enbxOYBQNSSPt5HW9zMr_ZSkbQoV68WX%3DzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

ricardodani
actually, or use 'mysite.viess.hello' on the second argument of your url definition

2014-11-11 13:07 GMT-02:00 Ricardo L. Dani <[hidden email]>:
missing

from .views import hello

on urls.py

or use 'hello' as string

2014-11-11 11:54 GMT-02:00 tkdchen <[hidden email]>:

这不是Django的问题。你先把Python搞明白。

On Sunday, November 9, 2014 11:29:58 PM UTC+8, [hidden email] wrote:

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']

--
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 [hidden email].
To post to this group, send email to [hidden email].
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



--
[]`s
Ricardo L. Dani

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAEq3mei4Hd_t%3DZPaL23Q7yhQohPpm9VTAda5V8SPtrqyMZ-G6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.