Changeset 2652 for package_branches


Ignore:
Timestamp:
Dec 20, 2009, 5:26:48 PM (15 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/code
Files:
3 edited

Legend:

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

    r2651 r2652  
    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/code/main.py

    r2648 r2652  
    99import datetime
    1010import hmac
     11import os
    1112import random
    1213import sha
     
    4344import ajaxterm
    4445
     46
     47static_dir = os.path.join(os.path.dirname(__file__), 'static')
     48InvirtStatic = cherrypy.tools.staticdir.handler(
     49    root=static_dir,
     50    dir=static_dir,
     51    section='/static')
     52
    4553class InvirtUnauthWeb(View):
     54    static = InvirtStatic
     55
    4656    @cherrypy.expose
    4757    @cherrypy.tools.mako(filename="/unauth.mako")
     
    5868                                                 'from invirt import database']
    5969        self._cp_config['request.error_response'] = self.handle_error
     70
     71    static = InvirtStatic
    6072
    6173    @cherrypy.expose
  • package_branches/invirt-web/cherrypy/code/unauth.fcgi

    r2651 r2652  
    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.