26 lines
529 B
Python
26 lines
529 B
Python
from flask import Flask, render_template
|
|
import glob
|
|
import random
|
|
|
|
app = Flask(__name__)
|
|
|
|
imgs = []
|
|
fonts = []
|
|
|
|
|
|
@app.route('/')
|
|
def index():
|
|
return render_template('index.html',
|
|
imgp=random.choice(imgs),
|
|
fontp=random.choice(fonts))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
for f in glob.glob("./static/images/*"):
|
|
imgs.append(str(f)[9:])
|
|
|
|
for f in glob.glob("./static/fonts/*"):
|
|
fonts.append(str(f)[9:])
|
|
|
|
app.run(host='0.0.0.0', debug=False, port=5555)
|