基於flask實現的簡單部落格
技術棧:
boostrap + flask + sqlalchemy + sqlite3(資料庫)
python版本:
Python3
requirement:
click==6.7
Flask==0.12.2
Flask-Login==0.4.0
Flask-SQLAlchemy==2.2
Flask-WTF==0.14.2
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
SQLAlchemy==1.1.14
Werkzeug==0.12.2
WTForms==2.1
使用說明:
virtulenv env
. env/bin/activate
pip install -r requirement.txt
python3 db_create.py(生成資料庫app.db)
python3 run.py
檔案目錄:
app
├── forms.py
├── init.py
├── models.py
├── static
│ ├── css
│ │ ├── bootstrap.min.css
│ │ └── bootstrap-responsive.min.css
│ └── js
│ └── bootstrap.min.js
├── templates
│ ├── base.html
│ ├── change.html
│ ├── detail.html
│ ├── edit.html
│ ├── flash.html
│ ├── index.html
│ ├── login.html
│ ├── manage.html
│ ├── sign_up.html
│ ├── user.html
│ └── write.html
└── views.py
功能演示:
1.登入註冊
2.首頁
3.寫文章
點選左側的write
4.管理個人文章和編輯資料
點選edit your profile修改about me,點選edit和delete可以編輯或者刪除文章
5.登出
點選導航欄的logout
6.歸檔
點選archive,未實現
7.about me
點選about me顯示個人介紹,未實現
這是一個練習的demo,希望能夠對初學者有所幫助