commit b1926e650f6e1bae565183026ce388393ebbd4f0
parent bfe38aa18b10fb9dd0eebd4661b9950c9075d036
Author: Shiimoe <SameulFrost@tuta.io>
Date: Sun, 13 Sep 2020 21:57:39 +0100
ip logger lol
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/server.py b/server.py
@@ -33,12 +33,14 @@ def postcomment():
name = request.form['name']
comment = request.form['comment']
date = datetime.now()
+ ip = request.remote_addr
comments = read_comments()
comments.append({
'name': name,
'comment': comment,
- 'date': datetime.strftime(date, DATE_FORMAT)
+ 'date': datetime.strftime(date, DATE_FORMAT),
+ 'ip': ip
})
with open(COMMENT_FILE, 'w') as f: