Last active
August 29, 2015 13:57
-
-
Save marcelnicolay/9552849 to your computer and use it in GitHub Desktop.
Site simples em Python usando Webpy + Nginx + uWSGI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import web | |
import os | |
t_globals = { | |
'datestr': web.datestr | |
} | |
render = web.template.render('{0}/templates'.format(os.path.dirname(os.path.abspath(__file__))), globals=t_globals, cache=False) | |
urls = ( | |
'/', 'index', | |
) | |
class index: | |
def GET(self): | |
return render.index() | |
wsgiapp = web.application(urls, globals()).wsgifunc() | |
if __name__ == "__main__": | |
app = web.application(urls, globals()) | |
app.internalerror = web.debugerror | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment