Creating Dynamic Pages with Python
Hi,
I am new in this MWS area.
I was trying to follow the example given in the PDF file ([url]http://mymobilesite.net/files/MobileWebServer_Book_en.pdf[/url]) under "Nokia Mobile Web Server"
I have followed the guidelines given in Page 75 under "Creating Dynamic Pages with Python". I tried to run the following code with two files (ht.acl & test.py).
[COLOR="RoyalBlue"]######## test.py (From Page 113)[/COLOR]
def handler(req):
from mod_python import apache
req.content_type = ’text/html’
req.write(”<html>Hello World!</html>”)
return apache.OK
[COLOR="royalblue"]######### ht.acl (From Page 113)[/COLOR]
AddHandler mod_python .py
PythonHandler test
PythonDebug On
Options None
Order Deny,Allow
Allow from all
<FilesMatch ”\.(pyc)$”>
Deny from all
</FilesMatch>
I tried to run the test application by requesting the following URL:
[url]https://testapplication.mymobilesite.net/test/test.py[/url]
I find the following Error message:
#########
[COLOR="Magenta"]The website cannot display the page
HTTP 500
Most likely causes:
The website is under maintenance.
The website has a programming error.
What you can try:
Refresh the page.
Go back to the previous page.
More information
This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.[/COLOR]
#########
Any idea how to solve the problem?
Re: Creating Dynamic Pages with Python
Hi.
I copy/pasted that code from your post and found it also causing the same error. After looking it again with the editor I noticed that the ' and " characters were little different. I changed those to "normal" and then it worked. Try that out, I hope it starts working for you too!
Re: Creating Dynamic Pages with Python
Hi,
It works for me too :)
Thanks a lot - it's a great help and finding! I had no clue.
[QUOTE=jpusa;553488]Hi.
I copy/pasted that code from your post and found it also causing the same error. After looking it again with the editor I noticed that the ' and " characters were little different. I changed those to "normal" and then it worked. Try that out, I hope it starts working for you too![/QUOTE]