Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 32 lines (28 sloc) 930 Bytes
#!/usr/bin/env python
# Use your virtualenv python as the shebang
try:
from wsgiref.handlers import CGIHandler
from flask import Flask, request
from flask.ext.twip import Twip
from flask.ext.twip.backend import FileBackend
from flask.ext.twip.environment import CGIEnvironment
import sys
import os
import logging
except Exception as e:
print("Content-type: text/html")
print('')
print(repr(e))
if __name__ == '__main__':
try:
app = Flask(__name__, static_folder=None)
app.config.from_object('settings')
be = FileBackend(folder='/home/yegle/cgi-bin/tokens')
twip = Twip(app, backend=be, url='/', environment=CGIEnvironment)
handler = CGIHandler()
handler.get_stderr = lambda: open('twip.log', 'a')
handler.run(app)
except Exception as e:
print("Content-type: text/html")
print("")
print(repr(e))