[mod_python] [SPAM] Sample .psp code returns a blank page

Rob Shinn rob.shinn at gmail.com
Thu May 22 15:39:10 EDT 2008


Ok, just ignore that last one... :(  Sorry, If I had googled, I would have
found that _apache isn't a 'real' module.

I also installed mod_python-3.3.1 from source, and it still doesn't work.  I
figure it must have to be something to do with my Apache configuration?

On Thu, May 22, 2008 at 1:48 PM, Rob Shinn <rob.shinn at gmail.com> wrote:

> Ok, more help:
>
> This is what I get from python when I try to import apache and psp from
> mod_python directly into the Python interpreter:
>
> >>> from mod_python import apache,psp
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.5/site-packages/mod_python/apache.py", line 28, in
> <module>
>     import _apache
> ImportError: No module named _apache
> >>> from mod_python import psp
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.5/site-packages/mod_python/psp.py", line 20, in
> <module>
>     import apache, Session, util, _psp
>   File "/usr/lib/python2.5/site-packages/mod_python/apache.py", line 28, in
> <module>
>     import _apache
> ImportError: No module named _apache
> >>>
>
> Something seems broken here.
>
>
>
>
>
> On Thu, May 22, 2008 at 8:43 AM, Rob Shinn <rob.shinn at gmail.com> wrote:
>
>> <html>
>> <%
>> import time
>> %>
>> Hello <%=what%> the time is: <%=time.strftime("%Y-%m-%d, %H:%M:%S")%>
>> </html>
>>
>>
>>
>> On Thu, May 22, 2008 at 8:26 AM, Graham Dumpleton <
>> graham.dumpleton at gmail.com> wrote:
>>
>>> Post the actual PSP code.
>>>
>>> 2008/5/22 Rob Shinn <rob.shinn at gmail.com>:
>>> > Yep.  Tried "view source" and it's empty. The PSP code is copied and
>>> pasted
>>> > from the first example in the docs.  What's weird is that the
>>> > PublisherHandler works just fine for non-PSP code.
>>> >
>>> >
>>> > On Wed, May 21, 2008 at 11:44 PM, Graham Dumpleton
>>> > <graham.dumpleton at gmail.com> wrote:
>>> >>
>>> >> Are you sure it is blank? Are you sure you haven't made a mistake in
>>> >> any HTML and the browser is treating the whole contents as part of the
>>> >> markup and therefore not displaying?
>>> >>
>>> >> Try 'View Source' on the response in the browser.
>>> >>
>>> >> Graham
>>> >>
>>> >> 2008/5/22 Rob Shinn <rob.shinn at gmail.com>:
>>> >> > tried running the sample "Hello, world" PSP script from the
>>> >> > documentation
>>> >> > but it just returns a blank page. I'm running mod_python 3.2.10 on
>>> >> > Apache
>>> >> > 2.2.3 running under Ubuntu 7.04 Feisty. Apache directives used to
>>> load
>>> >> > mod_python.psp:
>>> >> >
>>> >> > <Directory /var/www-sec/st/>
>>> >> >     AddHandler mod_python .psp .psp_
>>> >> >     PythonHandler mod_python.psp
>>> >> >     PythonDebug On
>>> >> > </Directory>
>>> >> >
>>> >> > I also tried using PSP through PublisherHandler. Same thing, the
>>> run()
>>> >> > method of the psp.PSP instance returns nothing:
>>> >> >
>>> >> > #!/usr/bin/env python
>>> >> > from mod_python import apache,psp
>>> >> >
>>> >> >
>>> >> > def handler(req):
>>> >> >   req.content_type = 'text/html'
>>> >> >   template = psp.PSP(req, filename='/var/www/st/test.psp')
>>> >> >   #req.write("%s" % template.run())
>>> >> >   template.run({'what':'hello'})
>>> >> >   req.flush()
>>> >> >   return apache.OK
>>> >> >
>>> >> > _______________________________________________
>>> >> > Mod_python mailing list
>>> >> > Mod_python at modpython.org
>>> >> > http://mailman.modpython.org/mailman/listinfo/mod_python
>>> >> >
>>> >
>>> >
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20080522/93f6b787/attachment.html


More information about the Mod_python mailing list