cd simple
source bin/activate
git clone https://github.com/orf/simple
cd simple
pip install -r requirements.txt
python create_config.py (回答它提出的问题,最后在当前目录下,会生成settings.py文件)
nohup python simple.py > /dev/null &
然后访问http://as3.brite.biz:5000/,就可看到效果。
登录地址:http://as3.brite.biz:5000/admin
演示站点:http://tomforb.es/simple,http://as3.brite.biz:5000
项目地址:https://github.com/orf/simple
Deployment:
Deploying Simple is easy. Simply clone this repo and install Gunicorn:pip install gunicorn
Then cd to the directory containing simple.py and run the following command:
gunicorn -w 4 simple:app
This will start 4 gunicorn workers serving Simple. You can then use nginx or apache to forward requests to Gunicorn.
跟apache webserver整合:
(simple)as3:~/simple/simple#
(必须先进入项目文件夹,即含有settings.py文件的那个文件夹里)
nohup gunicorn --workers=2 --bind 127.0.0.1:36487 simple:app > /dev/null &
mkdir /var/simple.brite.biz/
cd /var/simple.brite.biz/
nano .htaccess
( .htaccess的内容为:
ServerName simple.brite.biz
DocumentRoot /var/simple.brite.biz/
</VirtualHost>
相关帖子: http://briteming.blogspot.co.uk/2013/12/gunicornapachedjango.html
跟nginx webserver整合:
(simple)as3:~/simple/simple#
(必须先进入项目文件夹,即含有settings.py文件的那个文件夹里)
nohup gunicorn --workers=2 --bind 127.0.0.1:36486 simple:app > /dev/null &
让Nginx代理Gunicorn服务,编辑nginx的配置文件,加入下面的server段:
server {
listen 81;
server_name simple.brite.biz;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:36486;
}
}
重启Nginx即可。演示站点:http://simple.brite.biz:81/
Simple 2
I’ve just about finished the next version of Simple , the markdown based blog that powers this site.
When I first made Simple it was because I disliked WordPress, which seemed a bit too bloated. Then I saw Svbtle and I really liked the minimalist design (mostly the posting interface ) and decided to make a clone in Python.
This worked great and powered my blog for three years or so without any issues, but I became a bit tired of the minimal white design and wanted something with a bit more to look at. When I stumbled across the HPSTR Jekyll Theme I really liked the layout and design and decided to adapt that for the next version of Simple.
And so here it is. It tries to stay true to it’s name by being simple to use and install whilst still having a decent feature set and a nice design. The editing interface is a styled textarea that grows as you type, and adding an image is a simple as dragging and dropping it onto the page. This will upload the image and insert the right markdown at your cursor position. You can also edit the title by just selecting it and typing.
One thing I really liked about the HPSTR theme is the large image header, and I decided to combine this with the Bing daily image . When writing a post you can view the last 25 daily images by clicking the picture icon in the top right and using the left and right arrows to navigate.
I’ve tried to make installing Simple a painless as possible. You create a virtual environment for Simple, install the package and then use the ‘simple’ command to create a blog. Creating and maintaining config files is a pain, so you can use the simple command to create nginx and supervisord config files with the right file paths included (You will likely need to run apt-get install nginx or yum install nginx, and install supervisor to use them).
>> mkdir blog && cd blog
>> python3.4 -m venv env
>> source env/bin/activate && pip install simpleblogging gunicorn
>> simple create
>> nano simple_settings.py
>> simple nginx_config yoursite.com --proxy_port=9009 > /etc/nginx/conf.d/simple.conf
>> simple supervisor_config env/ 9009 >> /etc/supervisord.conf
>> chown -R nobody:nobody ../blog
>> supervisorctl start simple && service nginx reload
And that’s all you need.
frm https://tomforb.es/simple-2/
相关帖子:
http://briteming.blogspot.co.uk/2013/12/linux-vpspythondjango-djangoselfblog.html