Commit b284c0e5 authored by Nane Kratzke's avatar Nane Kratzke
Browse files

Solution

parent 9737a4cc
FROM python:3-slim
FROM python:3-alpine
WORKDIR /app
ADD requirements.txt ./
RUN pip install -r requirements.txt
RUN pip install -r requirements.txt && \
rm requirements.txt
CMD ["python", "-u", "app.py"]
......
from flask import Flask, request
from flask import Flask, request, abort
import wikipedia
app = Flask(__name__, static_folder="static")
@app.route("/")
def index():
content = request.args.get('proof', default="")
return f"""<h1>Hello</h1>
I am generated content:
<p>{ content }</p>
"""
wiki = request.args.get('wiki', default="Lübeck")
try:
wikipedia.set_lang("de")
content = wikipedia.page(wiki).summary
return f"""<h1>{ wiki }</h1>
Ich habe dies auf Wikipedia gefunden:
<p>{ content }</p>
"""
except:
abort(404, f"{ wiki } not found")
print("Starting ...")
# print("Starting ...")
app.run(host="0.0.0.0", port=8080)
\ No newline at end of file
flask
pandas
\ No newline at end of file
wikipedia
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment