mod_python and css

Discussion in 'Python' started by Bradley Hintze, Jun 24, 2010.

  1. Hi all,

    the mod_python mailing list is pretty dead so I thought I'd try asking
    my question here.

    I am using mod_python and am having trouble with my .py scripts that
    output HTML. the HTML comes out alright but my style sheets are not
    being rendered. I am sure that this has to do withe a mod handler
    problem.

    Here is what I have in httpd.conf:

    <Directory /Library/WebServer/Documents/css>
    AddHandler mod_python .css
    PythonHandler handler::handler_css
    PythonDebug On
    </Directory>


    Here is what handler.py looks like:

    from mod_python import apache

    def _dump(req, extension):
    req.content_type = 'text/plain'
    print >> req, 'uri = %s' % req.uri
    print >> req, 'filename = %s' % req.filename
    print >> req, 'path_info = %s' % req.path_info
    print >> req, 'extension = %s' % extension
    return apache.OK

    def handler(req):
    return _dump(req, '')

    def handler_css(req):
    return _dump(req, '.css')


    Any ideas on what I'm doing wrong?

    --
    Bradley J. Hintze
    Graduate Student
    Duke University
    School of Medicine
    801-712-8799
     
    Bradley Hintze, Jun 24, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?G=E9rard_Talbot?=

    Whining and bitching about MSIE 6 CSS bugs and CSS support

    =?ISO-8859-1?Q?G=E9rard_Talbot?=, Jul 9, 2005, in forum: HTML
    Replies:
    0
    Views:
    427
    =?ISO-8859-1?Q?G=E9rard_Talbot?=
    Jul 9, 2005
  2. Markus Schaber

    Apache mod_python and Sessions

    Markus Schaber, Jul 4, 2003, in forum: Python
    Replies:
    7
    Views:
    864
    Irmen de Jong
    Jul 8, 2003
  3. David Connell

    Mod_Python and ExpatPy

    David Connell, Jul 29, 2003, in forum: Python
    Replies:
    0
    Views:
    270
    David Connell
    Jul 29, 2003
  4. blbmdsmith
    Replies:
    1
    Views:
    662
    Graham Dumpleton
    Dec 14, 2006
  5. Thomas Jollans

    Re: mod_python and css

    Thomas Jollans, Jun 24, 2010, in forum: Python
    Replies:
    1
    Views:
    331
    John Nagle
    Jun 24, 2010
Loading...

Share This Page