Official documentation: Multipart Forms
Install Falcon (3.0+ required for ASGI) and the
uvicorn
ASGI app server:pip install -U "falcon >= 3.0.0" pip install uvicorn
# Credit: @vytas7 (Vytautas Liuolia) | |
import queue | |
import signal | |
import threading | |
import time | |
import uuid | |
import falcon |
# # docker run --rm -it -p 27017:27017 mongo | |
# $ gunicorn --workers 8 --worker-class=meinheld.gmeinheld.MeinheldWorker test:app | |
import itertools | |
import random | |
import falcon | |
import pymongo | |
import random | |
import time | |
import uuid | |
import falcon | |
class RequestMonitor: | |
def __init__(self, req, resp): |
Official documentation: Multipart Forms
Install Falcon (3.0+ required for ASGI) and the uvicorn
ASGI app server:
pip install -U "falcon >= 3.0.0"
pip install uvicorn
import falcon.asgi | |
import httpx | |
class Proxy(object): | |
UPSTREAM = 'https://falconframework.org' | |
def __init__(self): | |
self._client = httpx.AsyncClient() |
#!/usr/bin/env python | |
import asyncio | |
import logging | |
import threading | |
import uuid | |
import falcon | |
import falcon.asgi | |
import gunicorn.app.base | |
import uvicorn |
import cgi | |
import functools | |
import falcon | |
class TextHandler(falcon.media.BaseHandler): | |
DEFAULT_CHARSET = 'utf-8' | |
@classmethod |
Multipart form handling should be performant, straightforward, and leave full control of the parsing process to the user, i.e. no surprising magic such as automatic creation of large files and saving anything there by default (although tools/helpers may exist to assist in that too).
import logging | |
import aiohttp | |
import falcon | |
import falcon.asgi | |
# NOTE(vytas): Useful since ASGI otherwise has nothing like wsgierrors. | |
logging.basicConfig( | |
format='%(asctime)s [%(levelname)s] %(message)s', level=logging.INFO) |
import logging | |
import aioboto3 | |
import falcon.asgi | |
logging.basicConfig( | |
format='%(asctime)s [%(levelname)s] %(message)s', level=logging.INFO | |
) | |