贊助方

Blog

Aldryn News & Blog Integration

Translated from 集成博客/新闻模块

Aldryn News & Blog is allowable module to be used with DjangoCMS. Bellow, we are going to apply it to our project as our blog module.

1. install Aldryn News & Blog


Get into the environment to develope our project, and execute the command below to install Aldryn News & Blog:

pip install aldryn-newsblog

After the installation, get into the Aldryn News & Blog installation directory, and we can see actually there are a few things installed.

Because I install by Anaconda, so the directory is located in C:UsersMyAnaconda2Libsite-packages. The directory would vary from the way you install.

Set Aldryn News & Blog


Open the settings.py file, amd add the codes after 'cms' in INSTALLED_APPS:

 

    # you will probably need to add these
    'aldryn_apphooks_config',
    'aldryn_categories',
    'aldryn_common',
    'aldryn_newsblog',
    'aldryn_people',
    'aldryn_reversion',
    'aldryn_translation_tools',
    'parler',
    'sortedm2m',
    'taggit'

Effect after adding:

Remider:
In normal situation, the function is complete with the above steps, but in the case that aldryn_newsblog and djangocms are not integrated automatically, django-reversion is not added, although it is installed under the environment. So we need to add it into INSTALLED_APPS again; otherwise, we will get error message "<class> has not been registered with django-reversion", after we publish new article. </class>

After we adjust the INSTALLED_APPS, we need to migrate, so run the command below:

python manage.py migrate
View the effect

Click on the Advanced setting in the navbar, click on the application menu in the dialogue window, and we can see the selection "Aldryn NewsBlog Menu", which means that the installation is complete.

Next: Create article by News & Blog

Click here to download a PDF copy of this article

Save it to read later, or share with a colleague


Comment

There is no comment, you can make the first one!

Comment