Skip to content

Commit

Permalink
加入测试地址
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kepler committed Mar 7, 2017
1 parent b4eb0a1 commit 968791e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[TOC]

[博客测试地址](https://kepler.pythonanywhere.com)

# 1 结构

## 1.1 run.py
Expand Down
2 changes: 0 additions & 2 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ class Post(db.Model):
body_html = db.Column(db.Text) # 把markdown原文格式成html存到数据库,而不是访问时在格式
create_time = db.Column(db.DateTime, index=True, default=datetime.utcnow)
comments = db.relationship('Comment', backref='post')
# 尝试添加阅读统计
read_count = db.Column(db.Integer, default=0)
# 尝试设置私人文章
private = db.Column(db.Boolean, default=False)

# TODO
Expand Down
8 changes: 4 additions & 4 deletions app/templates/includes/_navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
id="7bc75dbef69e41ff2452de70079c8ece1320ea7c">
<ul class="nav navbar-nav">
<li {% if url_for('main.index') is current_link %}class="active"{% endif %}>
<a href="{{ url_for('main.index') }}" title="{{ ("主页") }}">{{ ("主页") }}</a>
<a href="{{ url_for('main.index') }}" title="{{ ("HOME") }}">{{ ("HOME") }}</a>
</li>
<!-- 根据日期group_by -->
<li {% if url_for('main.archive') is current_link %}class="active"{% endif %}>
<a href="{{ url_for('main.archive') }}" title="{{ ("归档") }}">{{ ("归档") }}</a>
<a href="{{ url_for('main.archive') }}" title="{{ ("ARCHIVE") }}">{{ ("ARCHIVE") }}</a>
</li>
<li {% if url_for('main.about') is current_link %}class="active"{% endif %}>
<a href="{{ url_for('main.about') }}" title="{{ ("关于") }}">{{ ("关于") }}</a>
<a href="{{ url_for('main.about') }}" title="{{ ("ABOUT") }}">{{ ("ABOUT") }}</a>
</li>

{% if current_user.is_administrator() %}
Expand All @@ -51,7 +51,7 @@
<!-- 全文搜索用google/baidu啊 -->
<form onsubmit = "return dispatch()" class="navbar-form" style="margin-top:10px; ">
<div class= "form-group has-feedback">
{{g.search_form.search(class="form-control input-sm", placeholder=("全文搜索"))}}
{{g.search_form.search(class="form-control input-sm", placeholder=("SEARCH HERE"))}}
<i class="icon-search form-control-feedback"></i>
</div>
</form>
Expand Down
11 changes: 10 additions & 1 deletion test/pythonanywhere/how.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

* 创建环境
mkvirtualenv flaskenv --python==python3.5
* 激活虚拟环境
source ./virtualenvs/flaskenv/bin/active
* 安装插件
pip install flask
pip install requestments/requestments.txt

* 激活虚拟环境

* mysql数据库
修改app/config.py的数据库连接SQLALCHEMY_DATABASE_URI:
Expand All @@ -15,3 +17,10 @@
* 不会改wsgi, 然后我新建一个flask的web应用就有了wsgi,然后直接改改这个就成了

* 好像也挺简单的, 可是部署后我的现在还不能发验证邮箱


***

1. 创建数据库
2. python manager.py db upgade

0 comments on commit 968791e

Please sign in to comment.