Skip to content

Instantly share code, notes, and snippets.

View mvikharev's full-sized avatar

Max Vikharev mvikharev

  • Zelenograd, Moscow, Russia
View GitHub Profile
@mvikharev
mvikharev / server_side_datatable.py
Created June 7, 2017 09:46 — forked from hammer/server_side_datatable.py
Implementation of a server-side DataTable (cf. http://datatables.net/release-datatables/examples/data_sources/server_side.html) using Flask, Flask-RESTful, and Psycopg. You should only have to edit source_database, source_table, and source_columns to make it work. Of course you'll probably want to edit the resource name and URL as well.
from string import Template
from distutils.util import strtobool
from flask import Flask, request
from flask.ext.restful import Api, Resource
import psycopg2
# Flask-RESTful Api object
app = Flask(__name__)
1. pip install -r reqs.pip
2. server.py
3. open client.html in browser
4. redis-cli publish push '123456'
5. check browser console