Skip to content

Instantly share code, notes, and snippets.

View 3dln's full-sized avatar
🌞
blessed

Ashkan Ashtiani 3dln

🌞
blessed
View GitHub Profile
@3dln
3dln / flask-upload
Created May 27, 2019 12:56 — forked from dAnjou/flask-upload
Flask upload example
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
@3dln
3dln / debug_stuff.py
Created May 25, 2019 07:35 — forked from dhrrgn/debug_stuff.py
A handy SQL debug function for Flask-SQLAlchemy
from . import app
from flask.ext.sqlalchemy import get_debug_queries
if app.debug:
app.after_request(sql_debug)
def sql_debug(response):
queries = list(get_debug_queries())
query_str = ''