commit 58e109d3017b774d4d2bbe4af0de4fc222024cba Author: dpedu Date: Sat Jun 13 23:58:09 2015 -0700 Initial commit diff --git a/app.py b/app.py new file mode 100755 index 0000000..03f8721 --- /dev/null +++ b/app.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 + +import sys +import cherrypy + +# Create a basic app +class App: + def __init__(self): + pass + + @cherrypy.expose + def index(self): + yield "It works!" +appinst = App() + +# Set up cherrypy config +appdir = "/home/python/app" +appconf = { + '/': { + 'tools.sessions.on':True, + 'tools.sessions.storage_type':'file', + 'tools.sessions.storage_path':appdir+'/sessions/', + 'tools.sessions.timeout':525600, + 'request.show_tracebacks': True + }, + '/media': { + 'tools.staticdir.on': True, + 'tools.staticdir.dir': appdir+"/static/" + } +} + +cherrypy.config.update({ + 'server.socket_port':3000, + 'server.thread_pool':1, + 'server.socket_host': '0.0.0.0', + 'sessionFilter.on':True, + 'server.show.tracebacks': True +}) + +cherrypy.server.socket_timeout = 5 + +sys.stderr = sys.stdout +cherrypy.config.update({'environment': 'embedded'}) +application = cherrypy.tree.mount(appinst, "/", appconf) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8d3c519 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +CherryPy==3.7.0 +Jinja2==2.7.3 +MarkupSafe==0.23