Get a blog running in five minutes!
Get a blog running in five minutes!#
First choose and follow the installation method of your choice.
Once you have CubicWeb setup, install the blog cube using the following command:
pip install cubicweb-blog
Then you can create and initialize your blog instance:
cubicweb-ctl create blog myblog
blog argument tells the command to use the blog
cube as a base for your instance named
If you get a permission error of the kind
OSError: [Errno 13] Permission denied: '/etc/cubicweb.d/myblog'
, read the next section.
This command will ask you a series of question. The first one is about the database engine to use (SQLite or PostgreSQL). For this tutorial, we will use SQLite as it is easier to setup and does not need a database server. In production environments, PostgreSQL is recommended as it offers better performances. More information on database configuration can be found here.
The command will also create a user used to manage your instance, for which you will be asked to give a name and password.
You can leave the remaining questions to their default by simply pressing
If you get errors during installation such as:
while handling language es: [Errno 2] No such file or directory: 'msgcat': 'msgcat' while handling language en: [Errno 2] No such file or directory: 'msgcat': 'msgcat' while handling language fr: [Errno 2] No such file or directory: 'msgcat': 'msgcat'
This means you are missing the
gettext dependency. To fix this, follow the instructions in the section Installing Dependencies.
Then either restart the installation process or run
cubicweb-ctl i18ncubicweb && cubicweb-ctl i18ncube blog after installation. More information in Internationalization.
Then you need to tell CubicWeb your instance is going to run on the localhost by editing
In this file under the
[MAIN] section, replace the line
#host=` by `host=localhost.
Once this process is complete (including database initialisation), you can start your instance by using:
cubicweb-ctl start -D myblog
-D option activates the debugging mode. Removing it will launch the instance
as a daemon in the background.
This is it, your blog is functional and running at http://localhost:8080!
About file system permissions#
Unless you installed from source, the above commands will initialize your instance as a regular user in your home directory (under ~/etc/cubicweb.d/). If you installed from source, your instance will be created in system directories and thus will require root privileges. To change this behavior, please have a look at the Resource mode section.
If you would like to change database parameters such as the database host or the
user name used to connect to the database, edit the
sources file located in the
Then relaunch the database creation:
cubicweb-ctl db-create myblog
Other parameters, like web server or emails parameters, can be modified in the
/etc/cubicweb.d/myblog/all-in-one.conf file (or
~/etc/cubicweb.d/myblog/all-in-one.conf depending on your configuration.)
You’ll have to restart the instance after modification in one of those files.