Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
e24a29e94f | |||
b3c2c7794a | |||
7ff1b70098 |
@ -12,9 +12,9 @@ from app import app
|
||||
from app import oidc
|
||||
|
||||
|
||||
@app.route('/')
|
||||
@app.route('/pvstats')
|
||||
@oidc.require_login
|
||||
def index():
|
||||
def pvstats():
|
||||
try:
|
||||
stepX_time = time.time()
|
||||
dbh = psycopg.connect()
|
||||
|
@ -38,3 +38,4 @@ tzdata==2025.1
|
||||
urllib3==2.3.0
|
||||
Werkzeug==3.1.3
|
||||
zipp==3.21.0
|
||||
pillow==11.1.0
|
||||
|
24
src/routes.py
Normal file
24
src/routes.py
Normal file
@ -0,0 +1,24 @@
|
||||
from flask import abort, Response
|
||||
from PIL import Image, ImageDraw
|
||||
import io
|
||||
from app import app
|
||||
from app import oidc
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
abort(404)
|
||||
|
||||
@app.route('/generate_image')
|
||||
def generate_image():
|
||||
img = Image.new('RGB', (200, 100), color=(255, 255, 255))
|
||||
|
||||
draw = ImageDraw.Draw(img)
|
||||
draw.text((50, 40), "Hello, Flask!", fill=(0, 0, 0)) # Schwarzer Text
|
||||
|
||||
img_io = io.BytesIO()
|
||||
img.save(img_io, 'PNG')
|
||||
img_io.seek(0) # Zeiger zurücksetzen
|
||||
|
||||
return Response(img_io, mimetype='image/png')
|
||||
|
@ -3,6 +3,7 @@ from loguru import logger
|
||||
|
||||
from app import app
|
||||
|
||||
import routes
|
||||
import debug_routes
|
||||
import pv_routes
|
||||
import ntp_routes
|
||||
|
Reference in New Issue
Block a user