Ignore:
Timestamp:
Dec 20, 2009, 9:48:10 PM (14 years ago)
Author:
broder
Message:

Setup hosting for static resources in the InvirtWeb? and
InvirtUnauthWeb? classes, instead of in the fcgi configuration.

Location:
package_branches/invirt-web/cherrypy-rebased/code
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy-rebased/code/auth.fcgi

    r2729 r2730  
    3636            'tools.invirtwebstate.on': True,
    3737            },
    38         '/static': {
    39             'tools.staticdir.root': static_dir,
    40             'tools.staticdir.on': True,
    41             'tools.staticdir.dir': static_dir,
    42             }
    4338        }
    4439                   
  • package_branches/invirt-web/cherrypy-rebased/code/main.py

    r2726 r2730  
    77import datetime
    88import hmac
     9import os
    910import random
    1011import sha
     
    3839from view import View, revertStandardError
    3940
     41
     42static_dir = os.path.join(os.path.dirname(__file__), 'static')
     43InvirtStatic = cherrypy.tools.staticdir.handler(
     44    root=static_dir,
     45    dir=static_dir,
     46    section='/static')
     47
    4048class InvirtUnauthWeb(View):
     49    static = InvirtStatic
     50
    4151    @cherrypy.expose
    4252    @cherrypy.tools.mako(filename="/unauth.mako")
     
    5363                                                 'from invirt import database']
    5464        self._cp_config['request.error_response'] = self.handle_error
     65
     66    static = InvirtStatic
    5567
    5668    @cherrypy.expose
  • package_branches/invirt-web/cherrypy-rebased/code/unauth.fcgi

    r2729 r2730  
    3636            'tools.invirtwebstate.on': True,
    3737            },
    38         '/static': {
    39             'tools.staticdir.root': static_dir,
    40             'tools.staticdir.on': True,
    41             'tools.staticdir.dir': static_dir,
    42             }
    4338        }
    4439                   
Note: See TracChangeset for help on using the changeset viewer.