I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.
- Flask is managed by
uWSGI. uWSGItalks tonginx.
| #!/usr/bin/env perl | |
| # | |
| # http://daringfireball.net/2007/03/javascript_bookmarklet_builder | |
| use strict; | |
| use warnings; | |
| use URI::Escape qw(uri_escape_utf8); | |
| use open IO => ":utf8", # UTF8 by default | |
| ":std"; # Apply to STDIN/STDOUT/STDERR |
Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer
Thanks for stopping by!
| import struct | |
| print( 8 * struct.calcsize("P")) | |
| import pygame | |
| from pygame import * | |
| from player import Player | |
| controls=[False, False, False, False] | |
| screen = pygame.display.set_mode((640, 400)) | |
| running = 1 | |
| player=Player("player.png", [100,150]) | |
| while running: |
| #!/usr/bin/env python | |
| from numpy import asmatrix, asarray, ones, zeros, mean, sum, arange, prod, dot, loadtxt | |
| from numpy.random import random, randint | |
| import pickle | |
| MISSING_VALUE = -1 # a constant I will use to denote missing integer values | |
| def impute_hidden_node(E, I, theta, sample_hidden): |
| """Flask extension utility.""" | |
| from flask.sessions import SessionInterface, SessionMixin | |
| from werkzeug.contrib.cache import MemcachedCache | |
| import memcache # Use https://code.launchpad.net/~songofacandy/python-memcached/mixin-threading | |
| def setup_cache(app): | |
| """ | |
| Setup ``app.cache``. |