diff --git a/.gitignore b/.gitignore index 2483976..78d8aee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea/ __pycache__/ +venv/ \ No newline at end of file diff --git a/database.sqlite b/database.sqlite index 4a528af..f78ebf8 100644 Binary files a/database.sqlite and b/database.sqlite differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a858539 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,24 @@ +alembic==1.5.2 +click==7.1.2 +et-xmlfile==1.0.1 +Flask==1.1.2 +Flask-Migrate==2.6.0 +Flask-Script==2.0.6 +Flask-SQLAlchemy==2.4.4 +itsdangerous==1.1.0 +jdcal==1.4.1 +Jinja2==2.11.2 +Mako==1.1.4 +MarkupSafe==1.1.1 +numpy==1.19.5 +openpyxl==3.0.6 +pandas==1.1.5 +PyMySQL==0.10.1 +python-dateutil==2.8.1 +python-editor==1.0.4 +pytz==2021.1 +six==1.15.0 +SQLAlchemy==1.3.22 +Werkzeug==1.0.1 +xlrd==2.0.1 +XlsxWriter==1.3.7 diff --git a/service.py b/service.py index 21708c5..0bb4563 100644 --- a/service.py +++ b/service.py @@ -366,8 +366,11 @@ def get_subject(subjectID): # ============================================================================================ @app.before_request def before_request(): - ip = IP - session['ip'] = ip + if request.headers.getlist("X-Forwarded-For"): + ip = request.headers.getlist("X-Forwarded-For")[0] + else: + ip = request.remote_addr + session['ip']=ip visitor = Visitor.query.filter_by(ip=ip).first() if visitor is None: visitor = Visitor(ip=ip) @@ -762,4 +765,4 @@ def author(author_id): if __name__ == '__main__': - app.run(debug=True) + app.run(debug=True,host="0.0.0.0") diff --git a/templates/article.html b/templates/article.html index 3a962c8..b31f5cf 100644 --- a/templates/article.html +++ b/templates/article.html @@ -132,7 +132,7 @@

{{ article.title }}

dislike

{{ article.downvote }}

 
-

dislike

{{ article.downvote }}

  +

download number

{{ article.downloadcount }}


@@ -193,8 +193,8 @@

{{ article.title }}

{% endfor %} - + {% if comments %} - + {% endif %} {% endblock %} diff --git a/templates/search.html b/templates/search.html index 1d83679..ae2c943 100644 --- a/templates/search.html +++ b/templates/search.html @@ -25,7 +25,7 @@ {{ Tool.highlight_matched_parts(article.title, kwd) | safe }} {{ Tool.highlight_matched_parts(article.abstract, kwd) | safe }} {{ Tool.highlight_matched_parts(article.highlight, kwd) | safe }} - {{ Tool.email_display_filter(article.author.mail) | safe }} + {{ Tool.email_display_filter(article.author.mail) | safe }} {{ article.time.strftime('%Y-%m-%d %H:%M') | safe }} {{ article.metric }} diff --git a/templates/subject.html b/templates/subject.html index 43c2de4..a3ae9d3 100644 --- a/templates/subject.html +++ b/templates/subject.html @@ -86,7 +86,7 @@ {% for article in articles.items %} {{ article.title }} - {{ Tool.email_display_filter(article.author.mail) }} + {{ Tool.email_display_filter(article.author.mail) }} {{ article.time.strftime("%Y-%m-%d %H:%M") }} {{ article.metric }}