Backend development with Flask: Setting up the Microblog project with Flask (+19, -2)
.env.example (+1, -0)
From:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/.env.example
To:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/.env.example
new file mode 100644
index 0000000..9dead41
--- /dev/null
+++ b/curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/.env.example
@@ -0,0 +1 @@
+MONGODB_URI=
.flaskenv (+3, -0)
From:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/.flaskenv
To:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/.flaskenv
new file mode 100644
index 0000000..add589c
--- /dev/null
+++ b/curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/.flaskenv
@@ -0,0 +1,3 @@
+FLASK_APP=app
+FLASK_ENV=development
+FLASK_RUN_PORT=5002
.python-version (+1, -0)
From:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/.python-version
To:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/.python-version
new file mode 100644
index 0000000..a5c4c76
--- /dev/null
+++ b/curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/.python-version
@@ -0,0 +1 @@
+3.9.0
app.py (+9, -0)
From:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/app.py
To:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/app.py
new file mode 100644
index 0000000..6af4a4c
--- /dev/null
+++ b/curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/app.py
@@ -0,0 +1,9 @@
+from flask import Flask, render_template
+
+
+app = Flask(__name__)
+
+
+@app.route("/", methods=["GET"])
+def home():
+ return render_template("home.html")
requirements.txt (+3, -0)
From:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/requirements.txt
To:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/requirements.txt
new file mode 100644
index 0000000..e368915
--- /dev/null
+++ b/curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/requirements.txt
@@ -0,0 +1,3 @@
+flask
+python-dotenv
+pymongo[srv]
styles.css (+0, -0)
From:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/start/styles.css
To:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/static/css/styles.css
similarity index 100%
rename from /curriculum/section07/lectures/08_setting_up_microblog_with_flask/start/styles.css
rename to /curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/static/css/styles.css
logo.svg (+0, -0)
From:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/start/logo.svg
To:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/static/logo.svg
similarity index 100%
rename from /curriculum/section07/lectures/08_setting_up_microblog_with_flask/start/logo.svg
rename to /curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/static/logo.svg
home.html (+2, -2)
From:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/start/home.html
To:
curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/templates/home.html
similarity index 92%
rename from /curriculum/section07/lectures/08_setting_up_microblog_with_flask/start/home.html
rename to /curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/templates/home.html
index 757f497..4089a35 100644
--- a/curriculum/section07/lectures/08_setting_up_microblog_with_flask/start/home.html
+++ b/curriculum/section07/lectures/08_setting_up_microblog_with_flask/end/templates/home.html
@@ -4,12 +4,12 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Microblog</title>
- <link rel="stylesheet" href="styles.css" />
+ <link rel="stylesheet" href="/static/css/styles.css" />
</head>
<body>
<header class="navbar">
<div class="navbar__brand">
- <img class="navbar__logo" src="logo.svg" alt="The Microblog logo" />Microblog
+ <img class="navbar__logo" src="/static/logo.svg" alt="The Microblog logo" />Microblog
</div>
<ul class="navbar__navigation">
<li class="navbar__navigation-item">