Skip to content

Instantly share code, notes, and snippets.

View 1mh0's full-sized avatar

Evgeny Petukhov 1mh0

  • Codepilot, Inc
  • Bangkok, Thailand
View GitHub Profile
@1mh0
1mh0 / pages.py
Created July 26, 2013 01:15
Bottle: default page callback
@pages_app.get('/:page')
@pages_app.get('/<section:re:(section|another-section)>/:page')
def simple_page(page, section=None):
page_id = request.path.strip('/')
page = Page.get_latest(page_id)
if not page:
return abort(404, "Page not found")
try:
return template('%s.html' % page_id, page=page)
except TemplateError:
@1mh0
1mh0 / flask-nginx-uwsgi
Created August 23, 2012 21:23
flask - nginx+uwsgi setup with git repository
apt-get update
apt-get install build-essential python-dev libxml2-dev
apt-get install nginx
/etc/init.d/nginx start
SETUP GIT REPOSITORY
~~~~~~~~~~~~~~~~~~~~
adduser git