一丶什么是Mezzanine?
它是基于django的内容管理平台(),组成简单,可扩展性和定制性强,特别是个小型的个人博客系统。它也提供了类似wordpress的管理页面、博客发布、图片展示等功能,配置简单,数据库灵活改变。相对于wordpress那样笨重繁多的功能来说,mezzanine显得非常轻笑,但麻雀虽小,五脏俱全,博客系统该有的东西,它都有提供。
二丶安装以来环境
接下来我以局域deblan发行版的linux系统为例,介绍如何搭建。
首先,确保你安装了python2.7(最好是这个版本),并且已经安装了pip,同事seruptools已经完成了更新。
输入下面的命令完成setuptools的更新:
pip install -U setuptools
接下来,我们安装一些python相关的依赖:
apt-get install python-imaging python-dev apt-get install libjpeg8 libjpeg8-dev build-dep
如果你用的是centos:
centos: yum install python-imaging python-dev
三丶安装Mezzanine
方式一、直接通过pip安装:
pip install mezzanine
我失败了,所以选择了下面这种方式,去官方的github clone文件,手动安装:
mkdir mezzanine-src cd mezzanine-src git clone https://github.com/stephenmcd/mezzanine.git
接下来,我们进入到目录中,执行安装命令:
python setup.py install
我在安装的时候特别慢,有些库下载直接超时,如果你也出现这种情况,建议可以考虑手动pip安装那些库。
安装mezzanine
新建python项目
alt+F12进入命令行界面
F:\Django\lxb_blog>pip install -U setuptools Collecting setuptools Downloading setuptools-38.5.1-py2.py3-none-any.whl (489kB) 100% |████████████████████████████████| 491kB 379kB/s Installing collected packages: setuptools Found existing installation: setuptools 28.8.0 Uninstalling setuptools-28.8.0: Successfully uninstalled setuptools-28.8.0 Successfully installed setuptools-38.5.1
F:\Django\lxb_blog>pip install mezzanine Collecting mezzanine Downloading Mezzanine-4.2.3-py2.py3-none-any.whl (6.1MB) 100% |████████████████████████████████| 6.1MB 126kB/s Collecting django-contrib-comments (from mezzanine) ...... Creating default account (username: admin / password: default) ... Installed 2 object(s) from 1 fixture(s) Creating demo pages: About us, Contact form, Gallery ... Installed 16 object(s) from 3 fixture(s)
F:\Django\lxb_blog\lxb_blog>python manage.py runserver D:\Program Files\python\lib\site-packages\mezzanine\utils\conf.py:61: UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django re quires. Will fall back to the domains configured as sites. warn("You haven't defined the ALLOWED_HOSTS settings, which " ...... March 06, 2018 - 08:46:22 Django version 1.10.8, using settings 'lxb_blog.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK.