Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import os | |
import re | |
import subprocess as sub | |
import argparse | |
import tempfile | |
import json | |
from concurrent.futures import ThreadPoolExecutor, as_completed |
Your Flask app object implements the __call__
method, which means it can be called like a regular function.
When your WSGI container receives a HTTP request it calls your app with the environ
dict and the start_response
callable.
WSGI is specified in PEP 0333.
The two relevant environ variables are:
SCRIPT_NAME
The initial portion of the request URL's "path" that corresponds to the application object, so that the application knows its virtual "location". This may be an empty string, if the application corresponds to the "root" of the server.