Made a flask server thing, gonna port it to django though ig.

This commit is contained in:
2025-10-21 23:28:37 +01:00
parent fb54dd37ff
commit ddf4caba62
15 changed files with 204 additions and 3 deletions

34
main.py Normal file
View File

@@ -0,0 +1,34 @@
from flask import Flask, render_template, request, redirect
from datetime import datetime
app = Flask(__name__)
def decide_ascii():
day = datetime.today().strftime('%d')
month = datetime.today().strftime('%m')
if month == "12":
return open(f'./ascii/christmas.html', 'r').read()
if month == "10":
return open(f'./ascii/halloween.html', 'r').read()
else:
return open(f'./ascii/normal.html', 'r').read()
@app.route('/')
def index():
ascii_penguin = decide_ascii()
return render_template('index.html', ascii_penguin = ascii_penguin)
@app.route('/mc')
def mc():
ascii_penguin = decide_ascii()
return render_template('mc.html', ascii_penguin = ascii_penguin)
if __name__ == '__main__':
app.run(
debug = True,
host = "0.0.0.0",
port = 8081
)