Skip to content

Instantly share code, notes, and snippets.

@marcelnicolay
Last active August 29, 2015 13:57
Show Gist options
  • Save marcelnicolay/9552849 to your computer and use it in GitHub Desktop.
Save marcelnicolay/9552849 to your computer and use it in GitHub Desktop.
Site simples em Python usando Webpy + Nginx + uWSGI
# 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