- blabla
- blabla id
-
- """
+ f = open(TEMPLATES_DIR / "base.jinja")
+ raw = f.read()
+ return raw
+
@app.route('/user/')
def user_profile(username):
# show the user profile for that user
return f'User {escape(username)}'
+
@app.route('/user/by_uuid/')
def user_id(user_id):
# show the user profile for that user
return f'Your mom has this id: {escape(user_id)}'
+
@app.route('/post/')
def post_show(post_id):
# show the post with the given id, the id is an integer
return f'Post {post_id}'
+
@app.route('/path/')
def subpath_show(subpath):
# show the subpath after /path/
return f'Subpath {escape(subpath)}'
+
with app.test_request_context():
print("{:=^80}".format("URIs"))
print(url_for('index'))
print(url_for('user_profile', username="yo mama"))
- print(url_for('user_id' ,user_id="blabla"))
+ print(url_for('user_id', user_id="blabla"))
print(url_for('post_show', post_id=1337))
print(url_for('subpath_show', subpath="blablabla"))
print(url_for('static', filename='style.css'))
diff --git a/flaskex/templates/base.jinja b/flaskex/templates/base.jinja
new file mode 100644
index 0000000..2819214
--- /dev/null
+++ b/flaskex/templates/base.jinja
@@ -0,0 +1,231 @@
+
+
+
+
+
+
+ Deine Mama
+
+
+
+
+
+
+
+
+
+
+
+
+
Dashboard
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Work with us
+
Anim aute id
+ magna aliqua ad ad non deserunt sunt. Qui irure qui lorem cupidatat commodo. Elit sunt
+ amet fugiat veniam occaecat fugiat.