[Tutor PyCZ] mod_python Tutorial

Tomas Brabenec konference na brabenec.net
Pátek Leden 13 09:26:02 CET 2006


Tomas Brabenec
http://brabenec.net
 



geon napsal(a):
> from mod_python import apache
>
> class handler:
>      def __init__(self, req):
>        self.zapisuj(req)
>
>    def zapisuj(self, req):
>        req.write( "Ja jsem instance!")
>
>        return apache.OK
>
> :-) , sice to zapisuje do stránky, ale navíc to pořád na konec píše, 
> že to vrací chybu - má to totiž vrátit číslo (nejlépe 0), ale vrací to 
> samu sebe (třída), takže výstup je chyba  a nevím jak to ošetřit bez 
> zásahu do apache.py ...
>
> <Directory "C:/Program Files/Apache Group/Apache2/htdocs/test">
>    AddHandler mod_python .py
>    PythonHandler mptest
>    PythonDebug On
> </Directory>
>
> Zdar
Tak to se mi to chova uplne stejne jako tobe, ale je divny, ze kdyz 
udelam toto:

<Directory "C:/www">
   AddHandler mod_python .py
   PythonHandler mod_python.publisher
   PythonDebug On
</Directory>


from mod_python import apache

class index:
    def __init__(self, req):
        self.zapisuj(req)

    def zapisuj(self, req):
        req.write( "Ja jsem instance!")

        return apache.OK   

Tak mi to pri pristupu napise: You don't have permission to access 
/mptest.py/index on this server.
To je divny.


Další informace o konferenci Tutor