This works as is, with a overly-controlling Apache environment:
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE conifer.settings
#PythonOption django.root /syrup
PythonOption django.root
PythonDebug Off
PythonPath "['/home/graham/projects/evergreen/servres/'] + sys.path"
</Location>
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@292
6d9bc8c9-1ec2-4278-b937-
99fde70a366f
template.filters.insert(0, Translator(_))
-dirs = ['templates']
+dirs = [settings.HERE('templates')]
loader = TemplateLoader(dirs, auto_reload=True, callback=template_loaded)
import simplejson as json
from xml.etree import ElementTree
import re
-import sys
+import sys, os
#------------------------------------------------------------
# Configuration
# FM_IDL_LOCATION = 'file:fm_IDL.xml'
FM_IDL_LOCATION = 'http://dwarf.cs.uoguelph.ca/reports/fm_IDL.xml'
+here = lambda s: os.path.join(os.path.dirname(__file__), s)
+FM_IDL_LOCATION = 'file:' + here('fm_IDL.xml')
#------------------------------------------------------------
# parse fm_IDL, to build a field-name-lookup service.
import os
-BASE_DIRECTORY = os.path.abspath(os.getcwd())
+BASE_DIRECTORY = os.path.abspath(os.path.dirname(__file__))
HERE = lambda s: os.path.join(BASE_DIRECTORY, s)
-DEBUG = True
+DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
from private_local_settings import SIP_HOST, SIP_CREDENTIALS
except:
pass
+
+CACHE_BACKEND = 'locmem:///'
return g.render('phys/mark_arrived_outcome.xhtml')
+
+def custom_error_handler(request):
+ cls, inst, tb = sys.exc_info()
+ #fixme, set 50x code.
+ return simple_message(_('Error: %s') % repr(inst),
+ repr((request.__dict__, inst)))
<?python
app_name = _('Syrup E-Reserve System')
search = _('search...')
+import os
?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
<div id="outer">
<div id="brandheader">
<div style="float: right; font-size: x-large; padding: 12; color: #888;">
+ ${os.getpid()}
${app_name}
</div>
<img src="/static/institution-logo.png" style="height: 50;"/>
{'document_root': settings.MEDIA_ROOT}),
(r'^accounts/(?P<path>.*)$', 'conifer.syrup.views.auth_handler'),
- (r'^syrup/setlang', 'conifer.syrup.views.setlang'),
+# (r'^syrup/setlang', 'conifer.syrup.views.setlang'),
(r'^syrup/i18n/', include('django.conf.urls.i18n')),
)
+
+if not settings.DEBUG:
+ handler500 = 'conifer.syrup.views.custom_error_handler'