From df5e26df339cbce7b3224cc79d9909ef6dc95db0 Mon Sep 17 00:00:00 2001 From: handsome Date: Fri, 7 Apr 2023 19:00:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib.txt | 32 ++++++++++++++++++++++++++++++ quickchat/models.py | 6 ++++-- quickchat/templates/chat/home.html | 2 +- readme.md | 4 +++- 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 lib.txt diff --git a/lib.txt b/lib.txt new file mode 100644 index 0000000..2316788 --- /dev/null +++ b/lib.txt @@ -0,0 +1,32 @@ +certifi==2018.10.15 +chardet==3.0.4 +Click==7.0 +dnspython==1.15.0 +eventlet==0.24.1 +Flask==1.0.2 +Flask-Login==0.4.1 +Flask-Moment==0.6.0 +Flask-MySQLdb==0.2.0 +Flask-OAuthlib==0.9.5 +Flask-SocketIO==3.0.2 +Flask-SQLAlchemy==2.3.2 +Flask-WTF==0.14.2 +idna==2.7 +itsdangerous==1.1.0 +Jinja2==2.10 +Markdown==3.0.1 +MarkupSafe==1.1.0 +monotonic==1.5 +oauthlib==2.1.0 +Pygments==2.2.0 +python-dotenv==0.9.1 +python-engineio==2.3.2 +python-socketio==2.0.0 +requests==2.20.0 +requests-oauthlib==1.0.0 +six==1.11.0 +SQLAlchemy==1.2.13 +urllib3==1.24.1 +webencodings==0.5.1 +Werkzeug==0.14.1 +WTForms==2.2.1 diff --git a/quickchat/models.py b/quickchat/models.py index c8c7235..57dfc89 100644 --- a/quickchat/models.py +++ b/quickchat/models.py @@ -1,6 +1,6 @@ import hashlib from datetime import datetime -from flask import current_app +from flask import current_app, url_for from flask_login import UserMixin, AnonymousUserMixin from werkzeug.security import generate_password_hash, check_password_hash @@ -25,6 +25,7 @@ def __init__(self, **kwargs): def set_password(self, password): self.password_hash = generate_password_hash(password) + # print("password_hash", generate_password_hash(password)) def verify_password(self, password): return check_password_hash(self.password_hash, password) @@ -39,7 +40,8 @@ def is_admin(self): @property def gravatar(self): - return 'https://gravatar.com/avatar/%s?d=monsterid' % self.email_hash + return url_for('static', filename='logo.png') + # return 'https://gravatar.com/avatar/%s?d=monsterid' % self.email_hash class Message(db.Model): diff --git a/quickchat/templates/chat/home.html b/quickchat/templates/chat/home.html index 3a363f2..2394a56 100644 --- a/quickchat/templates/chat/home.html +++ b/quickchat/templates/chat/home.html @@ -27,7 +27,7 @@
-

Written by Robin Dong
+{#

Written by Robin Dong
#} 2018 © quick_chat

diff --git a/readme.md b/readme.md index cefaadf..833b7bb 100644 --- a/readme.md +++ b/readme.md @@ -7,4 +7,6 @@ $ pip install -r requirements $ flask run * Running on http://127.0.0.1:5000/ -[Linux上应用部署流程](http://139.199.231.120:81/blog/10/) \ No newline at end of file +conda install -c conda-forge mysqlclient +conda install -c conda-forge greenlet +conda install -c conda-forge faker \ No newline at end of file