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

38 visualizzazioni
Passa al primo messaggio da leggere

zhoumin...@gmail.com

da leggere,
9 nov 2014, 10:29:5809/11/14
a 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
Il messaggio è stato eliminato

tkdchen

da leggere,
11 nov 2014, 08:54:0511/11/14
a django...@googlegroups.com
这不是Django的问题。你先把Python搞明白。

Ricardo L. Dani

da leggere,
11 nov 2014, 10:09:1711/11/14
a 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

da leggere,
11 nov 2014, 10:09:2211/11/14
a django...@googlegroups.com
actually, or use 'mysite.viess.hello' on the second argument of your url definition
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi