-1
我有一個函數在我的views.py打印一個字符串。我已經通過django運行本地服務器。 我寫了這段代碼。這個項目的頁面必須顯示單詞「hello world」,但它不是! 你能幫我解決嗎?如何將python代碼連接到服務器?
from django.conf.urls.defaults import *
from mysite.views import hello
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
('^hello/$', hello),
# Examples:
# url(r'^$', 'mysite.views.home', name='home'),
# url(r'^mysite/', include('mysite.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)
這只是URL路徑啓用更詳細的調試。我們無法看到任何返回「hello world」或正在生成的錯誤消息的代碼。 – Ewan 2013-05-09 14:11:16
這是我views.py內容:從django.http進口的HttpResponse 高清你好(請求): \t返回的HttpResponse(「世界你好」) – 2013-05-09 14:21:18
什麼是錯誤您收到? – Ewan 2013-05-09 14:40:49