flyhigher139 / octblog Goto Github PK
View Code? Open in Web Editor NEWYet another blog system powered by Flask and MongoDB
Home Page: https://blog.igevin.info
License: GNU General Public License v2.0
Yet another blog system powered by Flask and MongoDB
Home Page: https://blog.igevin.info
License: GNU General Public License v2.0
想把某篇POST置顶在最上方
很高兴楼主能开源这个项目,在些表示感谢。我现在想用这个来搭建一个个人博客,不过有一个疑问,就是系统中的多用户是个什么概念?
Hi,
I tried to launch the server from code, and always encounter this error:
ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused
raised by mongo-engine, I would like to know if your code will create a database instance ?
在 /admin 界面中可以创建新的Wechat 和 Page 这两个东西的作用有点不懂这两个界面的内容和 new post界面的内容一致呀。而且在OctBlog db中只有post这个collection,他们的具体分别只在post_type, 这是什么用意呀?
http://localhost:5000/admin/new-wechat/
http://localhost:5000/admin/new-page/
the docker build command is wrong, and the docker-compose file only work on one machine.
ERROR: for mongo Cannot start service mongo: error while creating mount source path '/Users/gevin/projects/data/mongodb': mkdir /Users/gevin: permission denied
按照教程在docker上部署了
执行 docker -ps 可以看到
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
049f3b122a91 gevin/octblog:0.1.2 "/usr/local/bin/super" 3 hours ago Up About an hour 5000/tcp, 8000/tcp, 0.0.0.0:8005->8005/tcp octblogmaster_blog_1
ca27f94bc5cc mongo:3.2 "docker-entrypoint.sh" 5 hours ago Up About an hour 27017/tcp octb
但是在外网8005端口无法访问
linux:debian 8
python:3.6
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install libapache2-mod-wsgi-py3
Apache 使用 .wsgi 来启动 Flask 程序。使用以下命令打开 /var/www/projectapp 目录,创建一个 flaskapp.wsgi 文件。
cd /var/www/projectapp
sudo nano flaskapp.wsgi
# 增加如下内容
#!/usr/bin/python
import sys
import logging
activate_this = '/var/www/OctBlog/venv/bin/activate_this.py' # 这是虚拟环境路径
with open(activate_this) as file_: # py3的调用
exec(file_.read(), dict(__file__=activate_this))
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/projectapp/") #你app的目录
from OctBlog import app
application = app
sudo nano /etc/apache2/sites-available/yoursite.conf
<VirtualHost *:80>
ServerName www.xxx.com
#ServerAlias xxx.com
#ServerAdmin [email protected]
# 存放用户上传图片等文件的位置,注意去掉#号
# Alias /media/ /var/www/ProjectName/media/
# 静态文件(js/css/images)的存放位置
Alias /static/ /var/www/OctBlog/app/static/
# 允许通过网络获取static的内容
<Directory /var/www/OctBlog/app/static/>
Require all granted
</Directory>
# wsgi文件
WSGIScriptAlias / /var/www/OctBlog/app/flaskapp.wsgi
</VirtualHost>
应用配置文件sudo a2ensite projectapp
重启apache2sudo service apache2 restart
!!!遇到问题查看errorlog,/var/log/apache2/error.log
In commit 608df90d56462cdbedc60c3d9211c3ec0cedaaf0, I add weight feature to Post
and Draft
And in commit 475032477fff25403e7f877f164d44be9c973f7e, I optimized the list_posts()
function to make the new feature compatible to old database.
But you may still want the old database fitting to the new data model.
In order to make them fitting, just run the following snippet in mongodb:
For Posts:
db.getCollection('post').update({}, {$set: {weight: NumberInt(10)}}, {multi: 1})
For Drafts:
db.getCollection('draft').update({}, {$set: {weight: NumberInt(10)}}, {multi: 1})
If you are using OctBlog, why not share it here?
我post一篇文章之后首页右上角显示出来这篇文章的slug但是首页不点进去就看不到他
你好,首先非常感谢你的分享。我想把你的代码部署到生产坏境去,采用nginx + gunicorn+centos,请问有详细的部署教程吗?我是Python新手,弄了两天也没有成功。需要你的帮助,万分感谢!
I have deployed the blog on my service,and I want change the homepage of my blog and I have changed environments variables in config.py,but the homepage of my blog is still the default page,How to change the ? thx.
感谢兄弟的开源博客,目前我改了下web ui,差不快改完了,三个问题请教一下:
1:老哥blog上线是用的阿云的哪个套餐啊?准备上线部署了,没找到合适的云主机
2:图片上传的url是别外生成的吗?flask-markdown好像没有这个功能,哥们有考虑在博客中实现直接上传图片文件吗?
3:域名绑定后,备案了吗?
先买了vultr一个月的套餐,域名还没有买绑定。
http://45.77.173.62/
Admin登录用户名和密码是多少?
请问 如果要实现 类似django http://www.cnblogs.com/dreamer-fish/p/5477178.html 分组细化权限配置的 要怎么实现啊?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.