[英]Why am I getting a syntax error on the first line of this code?
我無法理解語法錯誤是什么。
application(environ,start_response):
status = '200 OK'
html = '<html>\n' \
'<body>\n' \
' Hooray, mod_wsgi is working\n' \
'</body>\n' \
'</html>\n'
response_header = [('Content-type','text/html')]
start_response(status,response_header)
return [html]
File "test_wsgi_script.py", line 1 application(environ,start_response):
^
SyntaxError: invalid syntax
(scripts) root@django:/var/www/scripts#
在 function 調用之前需要 def 嗎?
def application(environ,start_response):
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.