diff --git a/app/app.py b/app/app.py index b687b85..f9f3f6c 100644 --- a/app/app.py +++ b/app/app.py @@ -161,7 +161,7 @@ def post(post_name: str): flask.abort(404) -# Games Page +# Category's Endpoint @app.route('/category//') def category_filter(category: str): @@ -264,10 +264,6 @@ def writing(): return flask.render_template('writing.html', works=works) - - - - # About Page @app.route('/about/') def about(): diff --git a/app/comment.py b/app/comment.py index 0e27ea6..1aa046d 100644 --- a/app/comment.py +++ b/app/comment.py @@ -1,4 +1,5 @@ import json +import os import flask import flask_wtf.csrf @@ -53,4 +54,8 @@ def get_comments(post_title : int) -> list[dict]: else: return [] +# Check Comments file exists +if not os.path.exists(COMMENTS_PATH): + with open(COMMENTS_PATH, 'w+') as file: + file.write('{}') diff --git a/app/user.py b/app/user.py index e7ae060..198ff5d 100644 --- a/app/user.py +++ b/app/user.py @@ -1,5 +1,6 @@ import base64 import json +import os import flask import flask_wtf.csrf @@ -94,3 +95,8 @@ def logout_user(): flask.session.pop('username') return flask.redirect('/') + +# Check User file exists +if not os.path.exists(USERS_PATH): + with open(USERS_PATH, 'w+') as file: + file.write('{}')