From f9f021e3a343eb37d8ef470a479e4e24b598bacc Mon Sep 17 00:00:00 2001 From: cylmemory <524545756@qq.com> Date: Tue, 6 Nov 2018 23:48:03 +0800 Subject: [PATCH 1/9] add readme --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7515280..88ea97b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # SimpleBlog -Building simple blog system by Flask and MongoDB. + +This is an exercise about blog .In this Blog,we can learn how to use [Flask](http://flask.pocoo.org/)-- +a microframework for Python based on Werkzeug and [MongoDB](https://www.mongodb.com/cn) rather than Django and sql Database. + This is my first project about flask,and I use Bootstrap as Frontend to decorate my blog succinctly.this is why it named SimpleBlog. + From 968a25b035787861355c1aa60d5f71a7129baf54 Mon Sep 17 00:00:00 2001 From: BOURNE CAI <524545756@qq.com> Date: Tue, 6 Nov 2018 23:54:40 +0800 Subject: [PATCH 2/9] Update README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 88ea97b..bf72773 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # SimpleBlog This is an exercise about blog .In this Blog,we can learn how to use [Flask](http://flask.pocoo.org/)-- -a microframework for Python based on Werkzeug and [MongoDB](https://www.mongodb.com/cn) rather than Django and sql Database. - This is my first project about flask,and I use Bootstrap as Frontend to decorate my blog succinctly.this is why it named SimpleBlog. +a microframework for Python based on Werkzeug and [MongoDB](https://www.mongodb.com/cn) rather than Django and sql Database. + +This is my first project about flask,and I use Bootstrap as Frontend to decorate my blog succinctly.this is why it named SimpleBlog. From bc1061077e949efae90091fbd93958f10f1e9fc5 Mon Sep 17 00:00:00 2001 From: BOURNE CAI <524545756@qq.com> Date: Wed, 7 Nov 2018 00:11:48 +0800 Subject: [PATCH 3/9] Update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index bf72773..08b9b2d 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,18 @@ a microframework for Python based on Werkzeug and [MongoDB](https://www.mongodb. This is my first project about flask,and I use Bootstrap as Frontend to decorate my blog succinctly.this is why it named SimpleBlog. +### Verion +- v1.0 --USER LOGIN +- V2.0 --POST and COMMENTS +- V3.0 --RESTful API + +### Feature +- Multiple user +- Role:admin,editor,writer,reader +- Admin models +- Email comfirm +- MTV design model +- Markdown support +- Multiple comment plugin +- Blog features: posts, tags, categories + From db7b3c871533dc2fb39b6f7b9722914458ae4b70 Mon Sep 17 00:00:00 2001 From: BOURNE CAI <524545756@qq.com> Date: Wed, 7 Nov 2018 00:13:35 +0800 Subject: [PATCH 4/9] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 08b9b2d..ca2dc21 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ This is my first project about flask,and I use Bootstrap as Frontend to decorate ### Verion - v1.0 --USER LOGIN -- V2.0 --POST and COMMENTS -- V3.0 --RESTful API +- v2.0 --POST and COMMENTS +- v3.0 --RESTful API ### Feature - Multiple user From c2c342a02453f289f599d82bc745d1bd442291b1 Mon Sep 17 00:00:00 2001 From: BOURNE CAI <524545756@qq.com> Date: Wed, 7 Nov 2018 20:46:01 +0800 Subject: [PATCH 5/9] Update README.md --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ca2dc21..b8bc483 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # SimpleBlog -This is an exercise about blog .In this Blog,we can learn how to use [Flask](http://flask.pocoo.org/)-- +This is an exercise about blog.In this Blog,we can learn how to use [Flask](http://flask.pocoo.org/)-- a microframework for Python based on Werkzeug and [MongoDB](https://www.mongodb.com/cn) rather than Django and sql Database. -This is my first project about flask,and I use Bootstrap as Frontend to decorate my blog succinctly.this is why it named SimpleBlog. +This is my first project about flask,and I use Bootstrap as Frontend to decorate my blog succinctly,this is why it named SimpleBlog. ### Verion - v1.0 --USER LOGIN @@ -18,5 +18,17 @@ This is my first project about flask,and I use Bootstrap as Frontend to decorate - MTV design model - Markdown support - Multiple comment plugin -- Blog features: posts, tags, categories +- Blog features: posts, tags, categories, comments +# Dependency +### Backend +- Flask +1.[Flask-WTF](https://flask-wtf.readthedocs.io/en/latest/) +2.[Flask-Login](https://flask-login.readthedocs.io/en/latest/) +3.[Flask-Admin](https://flask-admin.readthedocs.io/en/latest/) +4.[Flask_Mail](https://pythonhosted.org/Flask-Mail/) +5.[Flask-Principal](https://pythonhosted.org/Flask-Principal/) +6.[flask_mongoengine](http://docs.mongoengine.org/projects/flask-mongoengine/en/latest/) +7.[WTForms](https://wtforms.readthedocs.io/en/stable/) +- MongoDB +[mongoengine](http://docs.mongoengine.org/tutorial.html) From 24a025fb669b5c1da357bd57d74e58d39a9123f6 Mon Sep 17 00:00:00 2001 From: BOURNE CAI <524545756@qq.com> Date: Thu, 8 Nov 2018 11:47:04 +0800 Subject: [PATCH 6/9] Update README.md --- README.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b8bc483..811c765 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,76 @@ This is my first project about flask,and I use Bootstrap as Frontend to decorate 3.[Flask-Admin](https://flask-admin.readthedocs.io/en/latest/) 4.[Flask_Mail](https://pythonhosted.org/Flask-Mail/) 5.[Flask-Principal](https://pythonhosted.org/Flask-Principal/) -6.[flask_mongoengine](http://docs.mongoengine.org/projects/flask-mongoengine/en/latest/) +6.[flask_mongoengine](http://docs.mongoengine.org/projects/flask-mongoengine/en/latest/) 7.[WTForms](https://wtforms.readthedocs.io/en/stable/) - MongoDB [mongoengine](http://docs.mongoengine.org/tutorial.html) +- Markdown2 +- bleach +### Frontend +- Bootstrap +1.Clean Blog theme +2.bootbox.js +3.bootstrap-markdown.js +4.bootbox.js +- JQuery +- Ajax +### Restful API +route:`/SimpleBlog/app/api/v1/` +Including `Users` `Posts` `Comments` `Errors` +Take `Users` as example: + +|URL|Method|Description| +|--|--|--| +|/api/v1/users/|GET|Get all users list| +|/api/v1/new-user/|POST|Add a new user| +|/api/v1/users//|GET|Get a user information| +|/api/v1/users//|PUT|Modify a user information| +|/api/v1/users//|PATCH|Update a user information| +|/api/v1/users//|DELETE|Delete a user| + +This is HTTP method.Anthor is [Flask-Restful](https://flask-restful.readthedocs.io/en/latest/quickstart.html),you can find it in view function of this blog. +## How to Run +### First Step +Install your [MongoDB](http://www.runoob.com/mongodb/mongodb-osx-install.html) +Install virtual environment `virtualenv` +``` +$ sudo apt-get install python-virtualenv +``` +Install requirements: +``` +(sudo) pip install -r requirements.txt +``` +### Second Step +going to directory`SimpleBlog/app/config.py` to set you database name. + +### Third Step +Run SimpleBlog with this command: +``` +python manage.py runserver +``` +Then you can visit the blog with url: http://127.0.0.1:5052 + +If you want to customize manage.py, checkout [Flask-Script](https://flask-script.readthedocs.io/en/latest/) + +Get started with OctBlog +1. Create a superuser to administrate OctBlog +Visit the following url and create a superuser + +http://127.0.0.1:5052/useraccounts/register/admin + +If the url is forbidden, you need to go `SimpleBlog/app/config.py` to modify your configurations to allow the creation. + +2. Administrator interface +The admin home is: http://127.0.0.1:5052/admin + +3. Modify the default configurations +You either change settings in `SimpleBlog/app/config.py` file, or set the environment variables defined in this file. + +Setting environment variables is recommended, and once the configuration is changed, you need to restart the service. + + +## License +This project is licensed under the [MIT license](https://opensource.org/licenses/MIT), see LICENSE for more details. + +Finally,enjoy it! From aef32c26845c50c53b15df7e49f1b53761b51b6c Mon Sep 17 00:00:00 2001 From: BOURNE CAI <524545756@qq.com> Date: Thu, 8 Nov 2018 11:53:11 +0800 Subject: [PATCH 7/9] Update README.md --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 811c765..7718200 100644 --- a/README.md +++ b/README.md @@ -81,18 +81,19 @@ Then you can visit the blog with url: http://127.0.0.1:5052 If you want to customize manage.py, checkout [Flask-Script](https://flask-script.readthedocs.io/en/latest/) Get started with OctBlog -1. Create a superuser to administrate OctBlog -Visit the following url and create a superuser +1. Create a superuser to administrate OctBlog -http://127.0.0.1:5052/useraccounts/register/admin + Visit the following url and create a superuser -If the url is forbidden, you need to go `SimpleBlog/app/config.py` to modify your configurations to allow the creation. + http://127.0.0.1:5052/useraccounts/register/admin -2. Administrator interface + If the url is forbidden, you need to go `SimpleBlog/app/config.py` to modify your configurations to allow the creation. + +2. Administrator interface The admin home is: http://127.0.0.1:5052/admin -3. Modify the default configurations -You either change settings in `SimpleBlog/app/config.py` file, or set the environment variables defined in this file. +3. Modify the default configurations +You either change settings in `SimpleBlog/app/config.py` file, or set the environment variables defined in this file. Setting environment variables is recommended, and once the configuration is changed, you need to restart the service. From fad3ba62346918081d2a28677be998b98bf4ffe1 Mon Sep 17 00:00:00 2001 From: BOURNE CAI <524545756@qq.com> Date: Thu, 8 Nov 2018 18:01:09 +0800 Subject: [PATCH 8/9] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7718200..6e91e57 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ This is my first project about flask,and I use Bootstrap as Frontend to decorate ### Feature - Multiple user - Role:admin,editor,writer,reader -- Admin models +- Admin models +- Test Models - Email comfirm - MTV design model - Markdown support From 163c0e8c8b215a8f3d10ac60d922c7979e4e5dac Mon Sep 17 00:00:00 2001 From: BOURNE CAI <524545756@qq.com> Date: Thu, 25 Apr 2019 16:13:53 +0800 Subject: [PATCH 9/9] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6e91e57..95a853a 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,8 @@ Then you can visit the blog with url: http://127.0.0.1:5052 If you want to customize manage.py, checkout [Flask-Script](https://flask-script.readthedocs.io/en/latest/) -Get started with OctBlog -1. Create a superuser to administrate OctBlog +Get started with SimpleBlog +1. Create a superuser to administrate SimpleBlog Visit the following url and create a superuser