Skip to content

Instantly share code, notes, and snippets.

@sonnyksimon
Last active December 20, 2019 15:02
Show Gist options
  • Save sonnyksimon/905130e875cf1f47cdff38b2b0032858 to your computer and use it in GitHub Desktop.
Save sonnyksimon/905130e875cf1f47cdff38b2b0032858 to your computer and use it in GitHub Desktop.
A label for a merger between Flask and web.py's database API.
# -*- coding: -*-
"""
web
~~~
A label for a merger between Flask and web.py's database API.
import flaskweb as web
app = web.app(__name__)
db = web.database(dbn='postgres', host='127.0.0.1', port=5432,
user='username', pw='password', db='dbname')
@app.route('/', methods=['GET'])
def index():
todos = db.select('todo')
return web.render_template('index.html', todos=todos)
if __name__ == '__main__':
app.run()
:copyright: 2019 Pancubs.org
:license: MIT
"""
from flask import *
app = Flask
from web.utils import *
from web.db import *
def input():
return storage(request.form)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment