Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions lib.txt
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions quickchat/models.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion quickchat/templates/chat/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</div>
</div>
<div class="four wide column right floated right aligned hide-on-mobile">
<p>Written by <a href="http://139.199.231.120:81">Robin Dong</a><br>
{# <p>Written by <a href="">Robin Dong</a><br>#}
2018 © <a href="{{ url_for('chat.home') }}">quick_chat</a></p>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
conda install -c conda-forge mysqlclient
conda install -c conda-forge greenlet
conda install -c conda-forge faker