Skip to content

Commit

Permalink
added flask, reformatted from a html/css site
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmaclaren committed Mar 3, 2024
1 parent e041626 commit 7279d65
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
11 changes: 11 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from flask import Flask, render_template, request

app = Flask(__name__)


@app.route("/")
def home():
return render_template("index.html")

if __name__ == "__main__":
app.run(debug=True)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Flask
10 changes: 10 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "layout.html" %}

{% block title %}
Index
{% endblock %}

{% block main %}
<h1>Test</h1>

{% endblock %}
10 changes: 6 additions & 4 deletions index.html → templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="styles.css" rel="stylesheet">
<!-- Added Bootstrap to the page -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<title>Bootstrap demo</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<title>{% block content %}{% endblock %}</title>
</head>
<body>
<h1>Hello, world!</h1>
{% block main %}
{% endblock %}
</body>
</html>

0 comments on commit 7279d65

Please sign in to comment.