Django CMS:从aldrynblog更新到aldrynnewsblog

2024-04-29 12:52:57 发布

您现在位置:Python中文网/ 问答频道 /正文

Django CMS应用程序Aldryn blog is deprecated since 2015,并被Aldryn newsblog替换。

从aldryn blog更新到aldryn newsblog(兼容Django 1.6.11)的最佳方式是什么?最终目标是能够将Django系统从1.6.1x更新到1.7.y

  • 如何将奥尔德林博客条目迁移到奥尔德林新闻博客?在
  • 如何使aldryn新闻博客线索与HTML兼容?在
  • 从django1.6.x到django1.7.y并从aldryn blog迁移到aldryn newsblog的最佳连续更新是什么?在

我们当前设置的详细信息

要求.txt

--extra-index-url https://divio:wlkdjeorijlerf@pkg.divio.ch/simple/
--extra-index-url https://devpi.divio.ch/divio/all/+simple/
aldryn-apphooks-config==0.2.7
aldryn-blog==0.4.6
aldryn-boilerplates==0.7.4
aldryn-categories==1.0.2
aldryn-common==0.1.4
aldryn-faq==1.0.5
aldryn-gallery==0.2.1
aldryn-newsblog==1.2.1
aldryn-people==1.2.0
aldryn-reversion==1.0.8
aldryn-search==0.2.11
aldryn-translation-tools==0.2.1
argparse==1.2.1
cmsplugin-plaintext-djangocms3==0.2.1
dill==0.2.4
Django==1.6.11
django-admin-sortable==2.0.15
django-admin-sortable2==0.6.3
django-appconf==1.0.2
django-appdata==0.1.5
django-ckeditor==4.4.7
django-classy-tags==0.7.2
django-cms==3.0.15
django-countries==3.3
django-crispy-forms==1.5.1
django-filer==1.2.0
django-haystack==2.4.1
django-hvad==1.5.0
django-meta==0.3.1
django-meta-mixin==0.2.1
django-mptt==0.6.1
django-parler==1.6.2
django-phonenumber-field==1.1.0
django-polymorphic==0.8.1
django-reversion==1.8.4
django-sekizai==0.9.0
Django-Select2==4.3.1
django-sortedm2m==1.0.2
django-spurl==0.6.4
django-standard-form==1.1.4
django-taggit==0.11.2
django-treebeard==4.0
djangocms-admin-style==1.1.0
djangocms-column==1.4
djangocms-file==0.0.2
djangocms-flash==0.0.3
djangocms-googlemap==0.1.0
djangocms-inherit==0.0.2
djangocms-installer==0.5.4
djangocms-link==1.4.0
djangocms-picture==0.0.4
djangocms-snippet==1.5
djangocms-style==1.4
djangocms-teaser==0.0.2
djangocms-text-ckeditor==2.3.0
djangocms-video==0.0.2
factory-boy==2.5.2
fake-factory==0.5.3
html5lib==0.9999999
lockfile==0.10.2
mock==1.3.0
pandas==0.16.2
phonenumbers==7.3.1
phonenumberslite==7.3.1
Pillow==2.5.3
psycopg2==2.6.1
pytz==2014.7
six==1.10.0
South==1.0.2
wsgiref==0.1.2

您的项目中是否覆盖了Aldryn博客模板?

是的,但只是表面上的。目前,我们已经删除了奥尔德林博客模板,但可以恢复这一步骤。如果需要回答我的问题,我很乐意提供这些模板。在

您的项目中是否有自定义的Aldryn blog扩展?

没有

博客文章目前是否可搜索?(干草堆)

django-haystack已安装,但我们当前未使用此功能。在

您是否在使用Aldryn blog提供的任何插件?像作者或标签?

Aldryn的博客文章被标记并且有作者,但是我们没有使用标签或者BlogAuthors插件的额外功能。在

谢谢你!在


Tags: djangohttps模板urlindexadmindjangocmsblog
1条回答
网友
1楼 · 发布于 2024-04-29 12:52:57

以下是我对你的一些问题的回答:

如何使aldryn newsblog线索与HTML兼容?

是的,Aldryn newsblog使用djangocms文本编辑器的HTMLField

如何将奥尔德林博客条目迁移到奥尔德林新闻博客?

非常小心:)开玩笑。。。在

首先,完成迁移的唯一方法是在整个过程中保持在1.6上。 也就是说,在迁移完成之前,不要升级到Django>;=1.7。在

也就是说,为了给你提供尽可能多的信息, 请发布以下软件包的确切版本(或pip冻结):

  • Django公司
  • django CMS公司
  • django taggit公司
  • 奥尔德林博客
  • 奥尔德林新闻博客(是否已安装?)在
  • Aldryn Categories(它已经安装了吗?)在
  • django hvad公司
  • Djangoms文本编辑器

另外,还有一些问题:

您的项目中是否覆盖了Aldryn博客模板?在

您的项目中是否有自定义的Aldryn blog扩展?在

博客文章目前可以搜索吗?(干草堆)

编辑v1

我做这些迁移的方法是编写多个django管理命令,通常是一个“main”命令来调用其他命令。在

通过这样做,我可以在本地更快地迭代,并且在准备就绪(经过大量测试之后)直接在prod上运行命令(在升级必要的依赖项之后)。在

我强烈建议在迁移的本地开发期间使用stellar作为快速数据库快照。允许您快照和恢复数据库即时,是相当容易设置。在

下面是这样一个主命令的示例:

from django.core.management import call_command, CommandError
from django.core.management.base import NoArgsCommand
from django.db import connection

from south.db import db

from cms.models import Page


class Command(NoArgsCommand):
    can_import_settings = True

    def handle_noargs(self, **options):
        self.stdout.write("Running migrations.\n")

        # Migrate newsblog up to 0013
        call_command('migrate', 'aldryn_newsblog', '0013')

        # Now fake migration 0014 because we don't want the default
        # app config since we'll create it in a later step
        call_command('migrate', 'aldryn_newsblog', '0014', fake=True)
        # Now migrate all the way to 0027 because we need to fake 0028
        call_command('migrate', 'aldryn_newsblog', '0027')
        # This migration has unfortunate side effects when Aldryn blog
        # is installed in the system.
        # It's ok to fake it because is just a data migration
        call_command('migrate', 'aldryn_newsblog', '0028', fake=True)
        # Move to 0035 because we need to fake 0036
        call_command('migrate', 'aldryn_newsblog', '0035')
        # Because we're not using default apphook config, fake 0036
        call_command('migrate', 'aldryn_newsblog', '0036', fake=True)

        # Proceed with all migrations
        call_command('migrate')

        self.stdout.write('Setting up blog page.\n')
        call_command('setup_blog_page')

        self.stdout.write('Migrating Aldryn Blog to Aldryn News & Blog.\n')
        call_command('migrate_blog_to_newsblog')

现在,您需要setup_blog_pagemigrate_blog_to_newsblog命令。 在提供它们之前,我还有一个问题:

你有没有使用Aldryn的博客插件?像作者或标签?

相关问题 更多 >