page showing only code but not executing

5 views
Skip to first unread message

Amps

unread,
Jul 11, 2010, 7:22:58 AM7/11/10
to modwsgi
after i install wsgi and try to configure , the page is showing only
code but not executing i gueess ... what is the reason...

example .. the below code is displayed , when i ask for the page after
i did the WSGIScriptAlias mentioning the location.

def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'

response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)

return [output]



Thanks in advance

AMps

Graham Dumpleton

unread,
Jul 11, 2010, 6:06:06 PM7/11/10
to mod...@googlegroups.com

What instructions are you following? Are you using:

http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

Where did you put the WSGI script file?

Post the snippet from Apache configuration showing how you configured
Apache for mod_wsgi. Also indicate what DocumentRoot directive is set
to in Apache configuration.

At a guess this looks like you stuck the WSGI script file in Apache
document root (which you preferably shouldn't), then managed not to
get WSGIScriptAlias correct or didn't restart Apache, and then used a
URL which caused the WSGI script file to be served up as plain static
file rather than through mod_wsgi.

Graham

Amith

unread,
Jul 12, 2010, 2:57:21 AM7/12/10
to mod...@googlegroups.com
Traceback (most recent call last):
 File "/home/PU/amith.srinivasan/xxx/PCD.wsgi", line 7, in application
    start_response(status, response_headers)
 TypeError: expected byte string object for status, value of type str found

When i set the WSGi application i get the error as shown above.

My python version is :
python -V
Python 2.6.4



Thanks
Amith



--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To post to this group, send email to mod...@googlegroups.com.
To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.




--
Amith K S
ph :-) 09959844491

Graham Dumpleton

unread,
Jul 12, 2010, 3:05:32 AM7/12/10
to mod...@googlegroups.com
On 12 July 2010 16:57, Amith <ami...@gmail.com> wrote:
> Traceback (most recent call last):
>  File "/home/PU/amith.srinivasan/xxx/PCD.wsgi", line 7, in application
>     start_response(status, response_headers)
>  TypeError: expected byte string object for status, value of type str found
>
> When i set the WSGi application i get the error as shown above.
>
> My python version is :
> python -V
> Python 2.6.4

Are you loading mod_python into the same Apache instance?

If you are, disable mod_python, stop and then start (not restart or
reload) Apache and try again.

Graham

Reply all
Reply to author
Forward
0 new messages