mercurial/web/templates/hgweb.wsgi.j2
author Luke Hoersten <luke@hoersten.org>
Mon, 23 May 2022 20:59:36 -0500
changeset 179 65a0fb7c25a4
parent 58 baca37fdc8c3
permissions -rw-r--r--
Update versions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
# An example WSGI for use with mod_wsgi, edit as necessary
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
# See https://mercurial-scm.org/wiki/modwsgi for more information
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
# Path to repo or hgweb config to serve (see 'hg help hgweb')
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
config = "{{mercurial_uwsgi_root}}/hgweb.config"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
# Uncomment and adjust if Mercurial is not installed system-wide
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
# (consult "installed modules" path from 'hg debuginstall'):
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
#import sys; sys.path.insert(0, "/path/to/python/lib")
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
# Uncomment to send python tracebacks to the browser if an error occurs:
58
baca37fdc8c3 Updated hgweb config
Luke Hoersten <luke@hoersten.org>
parents: 56
diff changeset
    12
#import cgitb; cgitb.enable()
56
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
# enable demandloading to reduce startup time
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
from mercurial import demandimport; demandimport.enable()
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
from mercurial.hgweb import hgweb
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
application = hgweb(config.encode())