예제 #1
0
def start_app():
    from wsgi import application
    from smarttypes.utils import web_monitor
    web_monitor.start(interval=1.0)
    project_path = os.path.dirname(os.path.abspath(__file__))
    web_monitor.track(project_path + '/templates/')
    port = 9999
    httpd = make_server('localhost', port, application, handler_class=CustomRequestHandler)
    print "Serving on port %s..." % port
    httpd.serve_forever()
예제 #2
0
def start_app():
    import smarttypes
    from wsgi import application
    from smarttypes.utils import web_monitor
    web_monitor.start(interval=1.0)
    project_path = os.path.dirname(os.path.abspath(__file__))
    web_monitor.track(project_path + '/templates/')
    web_monitor.track(project_path + '/model/')
    port = 9999
    httpd = make_server('localhost', port, application, handler_class=CustomRequestHandler)
    print "Serving on port %s..." % port
    smarttypes.config.IS_PROD = False
    httpd.serve_forever()
예제 #3
0
def start_app():
    import smarttypes
    from wsgi import application
    from smarttypes.utils import web_monitor

    web_monitor.start(interval=1.0)
    project_path = os.path.dirname(os.path.abspath(__file__))
    web_monitor.track(project_path + "/templates/")
    web_monitor.track(project_path + "/model/")
    port = 9999
    httpd = make_server("localhost", port, application, handler_class=CustomRequestHandler)
    print "Serving on port %s..." % port
    smarttypes.config.IS_PROD = False
    httpd.serve_forever()
예제 #4
0
파일: wsgi.py 프로젝트: greeness/SmartTypes
import sys, site
site.addsitedir('/home/timmyt/.virtualenvs/smarttypes/lib/python%s/site-packages' % sys.version[:3])
sys.path.insert(0, '/home/timmyt/projects/smarttypes')

import re, traceback
from webob import Request
import smarttypes

from smarttypes.utils import web_monitor
web_monitor.start(interval=1.0)
web_monitor.track('/home/timmyt/projects/smarttypes/smarttypes/templates')

urls = [
    (r'^$', smarttypes.controllers.home),
   
    (r'blog/?', smarttypes.controllers.blog),
    
    (r'logged_in_user/?$', smarttypes.controllers.logged_in_user),
    (r'user/?$', smarttypes.controllers.user),
    (r'group/?$', smarttypes.controllers.group),
    
    (r'sign_in/?$', smarttypes.controllers.sign_in),
    (r'about/?$', smarttypes.controllers.about),
    (r'contact/?$', smarttypes.controllers.contact),
]

def application(environ, start_response):
    path = environ.get('PATH_INFO', '').lstrip('/')
    for regex, controller in urls:
        match = re.search(regex, path)