view odfcast/__init__.py @ 79:bd3e5fdd8398 1.0

Add apache site configuraton file for odfcase as wsgi application. Put the file apache-site.conf into /etc/apache2/sites-available/. It assumes that odfcast is installed as /home/mpuls/odfcast/releases/current and that there's a python environment with its site-packages in /home/mpuls/odfcast/env/lib/python2.7/site-packages. This is the setup used on the mpuls staging servers.
author Bernhard Herzog <bh@intevation.de>
date Wed, 25 Feb 2015 19:36:21 +0100
parents 4b78fe544b09
children 02efda1f6919
line wrap: on
line source
# -*- coding: utf-8 -*-

import logging

from flask import Flask

app = Flask(__name__)
app.config.from_object('odfcast.settings')
app.config.from_pyfile('odfcast.ini', silent=True)
app.config.from_envvar('ODFCAST_SETTINGS', silent=True)

if app.config["DEBUG"]:
    logging.basicConfig(level=logging.DEBUG)

from odfcast.convert import ConvertView, MergeView, TemplateView


app.add_url_rule("/convert/",
                 view_func=ConvertView.as_view(
                     "convert",
                     app.config["PY3O_UNO_DRIVER"],
                     app.config["PY3O_UNO_SERVER_HOSTNAME"],
                     app.config["PY3O_UNO_SERVER_PORT"],
                 ))
app.add_url_rule("/merge/",
                 view_func=MergeView.as_view("merge"),
                 )
app.add_url_rule("/",
                 view_func=TemplateView.as_view("index", "index.html"),
                 )
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)