Files
@ a718023f9e76
Branch filter:
Location: majic-ansible-roles/roles/wsgi_website/molecule/default/tests/data/python/paste/testapp.py - annotation
a718023f9e76
1.2 KiB
text/x-python
MAR-181: Drop support for Debian 9 Stretch from the backup_client role:
- Provide more details on use of pexpect+sftp backed for
Duplicity (backend has to be used on Debian 10 Buster as well, not
just Debian 9 Stretch).
- Switch to using IPs from VirtualBox default allowed host-only
network subnets.
- Provide more details on use of pexpect+sftp backed for
Duplicity (backend has to be used on Debian 10 Buster as well, not
just Debian 9 Stretch).
- Switch to using IPs from VirtualBox default allowed host-only
network subnets.
b68d19ad38a3 c8d4251a6ea5 c8d4251a6ea5 998aab91d6b4 b68d19ad38a3 b68d19ad38a3 998aab91d6b4 b68d19ad38a3 b68d19ad38a3 998aab91d6b4 998aab91d6b4 998aab91d6b4 b68d19ad38a3 b68d19ad38a3 b68d19ad38a3 b68d19ad38a3 b68d19ad38a3 998aab91d6b4 b68d19ad38a3 b68d19ad38a3 998aab91d6b4 998aab91d6b4 998aab91d6b4 998aab91d6b4 c8d4251a6ea5 b68d19ad38a3 b68d19ad38a3 b68d19ad38a3 998aab91d6b4 998aab91d6b4 998aab91d6b4 998aab91d6b4 998aab91d6b4 998aab91d6b4 998aab91d6b4 998aab91d6b4 998aab91d6b4 998aab91d6b4 c8d4251a6ea5 998aab91d6b4 998aab91d6b4 b68d19ad38a3 b68d19ad38a3 | import os
import sys
import flask
from flask import Flask
app = Flask(__name__, static_url_path='/keep-default-static-out-of-way')
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def index(path):
template = """<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{host}</title>
</head>
<body>
<p>This is the WSGI application at {host}.</p>
<p>Requested URL was: {scheme}://{host}{script}{path}
<p>MY_ENV_VAR: {my_env_var}</p>
<p>Accept-Encoding: {accept_encoding}</p>
<p>Python version: {python_version}</p>
</body>
</html>
"""
environ = flask.request.environ
parameters = {}
parameters['host'] = environ['HTTP_HOST']
parameters['scheme'] = environ['wsgi.url_scheme']
parameters['script'] = environ['SCRIPT_NAME']
parameters['path'] = environ['PATH_INFO']
parameters['my_env_var'] = os.environ.get('MY_ENV_VAR', None)
parameters['accept_encoding'] = environ.get('HTTP_ACCEPT_ENCODING')
parameters['python_version'] = "%s.%s.%s" % (sys.version_info.major, sys.version_info.minor, sys.version_info.micro)
output = template.format(**parameters)
return output
|