[PYTHON] Get started with Mezzanine

What is Mezzanine?

CMS made by Python / Django. It's like Wordpress or Movable Type. It's easy to link with third-party or homebrew Django apps, and you can manage your site flexibly. http://mezzanine.jupo.org/

I don't have much information in Japan, so I would like to write the introductory part for the time being.

How to get started

Preparation

This time, it is assumed that you have a Python development environment, so prepare the environment with virtualenv or pyenv.

Specifically, it is in the state of pyenv local mypython and work on mypython, but if you do not mind using the default Python environment such as Mac, you do not need to worry about these commands.

Installation

According to the official website

$ pip install mezzanine

Installing Mezzanine also installs dependent modules such as Django. My environment has Django 1.6.10 installed.

Project creation

$ mezzanine-project myproject

I used pyenv in my environment, but mezzanine-project I was told Not Found, so I activated it like source ~ / .pyenv / versions / mypython / bin / activate and I was able to execute it. You will be asked some interactive questions, so enter them each time.

DB creation for development

$ cd myproject
$ python manage.py createdb

The local default settings (local_settings.py) are supposed to use sqlite, so it may fail without sqlite. I haven't checked it well because it was in my environment, but in some cases it is better to use brew install sqlite3 etc. If you want to use MySQL etc., edit local_settings.py.

Check the screen

$ python manage.py runserver

By default, you can check the screen by accessing http: // localhost: 8000.

49bb45d4-ff72-4d10-860c-99e2397b3478.png

Edit template

When editing a template, it is convenient to copy the default template once and edit it. The following command will automatically duplicate the template provided by Mezzanine.

$ python manage.py collecttemplates

The templates directory will be added to the project directory, so you will be editing it. You can check options etc. with python manage.py collecttemplates --help.

Introduction of external themes

If you want to install a third-party Mezzanine theme, download it from, for example, http://thecodinghouse.in/themes/moderna/ and place it as a Django app (module) under your project directory. Then add the module name to the beginning of INSTALLED_APPS in settings.py. In the case of the previous URL, it will be as follows.

INSTALLED_APPS = (
	"moderna",  #add to
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    # ...
)

6d4e8149-7de8-4811-b8c2-0573f6306db2.png

If you created the templates directory earlier, that will be prioritized by default.

Expansion

Basically, it should be easy to install with the above procedure. I think that the site operation itself is not particularly different from other CMS, and the extension of the function is like creating a module etc. and adding it to INSTALLED_APPS like a normal Django project.

Impressions

This is the end of the introduction explanation, but as an aside, I would like to write a little impression of using Mezzanine.

Flexibility

To be honest, I haven't used many famous CMS such as Wordpress and Movable Type so I can't compare them, but by adding the Django app, I can create a site very flexibly. So it seems that it can be used not only for blogging but also for various purposes.

Abundant default settings

What impressed me most when I installed it was that many configuration files were already prepared at the time of installation. For example, requirements.txt and .gitignore, which are always prepared when developing a project, and crontab, supervisor.conf, which are necessary for operation, are included from the beginning. In particular, fabfile.py has a set of commands, so you don't have to think about deployment scripts from scratch just by installing Fabric.

share

(I can't say much because I don't have the data) There is still little information in Japan and I think Wordpress has an overwhelming share, but recently I have the impression that there are more people using Python than before, so it is a flexible CMS little by little. I personally think that it will be introduced.

Recommended Posts

Get started with Mezzanine
Get started with MicroPython
Get started with Django! ~ Tutorial ⑤ ~
Get started with influxDB + Grafana
Get started with Django! ~ Tutorial ⑥ ~
Get started with Python! ~ ② Grammar ~
Get started with Python! ~ ① Environment construction ~
Link to get started with python
Get started with MicroPython (on macOS)
How to get started with Python
How to get started with Django
Get started with machine learning with SageMaker
Get started with Python in Blender
Get started with the documentation tool Sphinx
Get Started with TopCoder in Python (2020 Edition)
How Python beginners get started with Python with Progete
How to get started with laravel (Linux)
[Blender x Python] Let's get started with Blender Python !!
Django 1.11 started with Python3.6
Get started Jupyter Notebook
The easiest way to get started with Django
Getting started with Android!
1.1 Getting Started with Python
Getting Started with Golang 2
Getting started with apache2
Getting Started with Golang 1
Getting Started with Python
Getting Started with Django 1
Getting Started with Optimization
Get Tweets with Tweepy
Getting Started with Golang 3
Get started with Python on macOS Big Sur
Get date with python
Getting Started with Numpy
Getting started with Spark
Getting Started with Python
Getting Started with Pydantic
Getting Started with Golang 4
Getting Started with Jython
A layman wants to get started with Python
[Cloud102] # 1 Get Started with Python (Part 1 Python First Steps)
Getting Started with Django 2
I tried to get started with blender python script_Part 01
I tried to get started with blender python script_Part 02
What I did to get started with Linux commands
Get country code with python
Translate Getting Started With TensorFlow
Get table dynamically with sqlalchemy
Getting Started with Python Functions
Getting Started with Tkinter 2: Buttons
Getting Started with Go Assembly
Getting Started with PKI with Golang ―― 4
Get Twitter timeline with python
Get Youtube data with python
Getting Started with Python Django (1)
Get information with zabbix api
Getting Started with Python Django (4)
Getting Started with Python Django (3)
Get thread ID with python
Getting Started with Python Django (6)
Get image features with OpenCV