~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/apps/__init__.py

  • Committer: Robert Collins
  • Date: 2012-02-02 05:07:53 UTC
  • mfrom: (464.1.1 mod-wsgi)
  • Revision ID: robertc@robertcollins.net-20120202050753-2d8f8r6m24lglbz5
    - Add a script and documentation for running under mod_wsgi.
      (Stuart Colville, Toshio Kuratomi)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""WSGI applications for serving Bazaar branches."""
 
2
 
 
3
import os
 
4
 
 
5
from paste import urlparser, fileapp
 
6
 
 
7
from loggerhead.util import convert_file_errors
 
8
 
 
9
static = os.path.join(
 
10
    os.path.dirname(os.path.dirname(__file__)), 'static')
 
11
 
 
12
# Static things can be cached for half a day, we could probably make this
 
13
# longer, except for just before rollout times.
 
14
static_app = urlparser.make_static(None, static, cache_max_age=12*60*60)
 
15
 
 
16
favicon_app = convert_file_errors(fileapp.FileApp(
 
17
    os.path.join(static, 'images', 'favicon.ico')))
 
18
 
 
19
robots_app = convert_file_errors(fileapp.FileApp(
 
20
    os.path.join(static, 'robots.txt')))