django-cms 2.4.0-RC1、django 1.5.1、および python 2.7 の新規インストールを実行します。単一のフィールドを持つ非常に単純なカスタム プラグインを作成しようとしています。プラグインは管理者に登録され、正常に動作します。データベースに正常に保存されます。私のテンプレートではレンダリングされていません。
render_template パスを確認し、ハードコーディングされた絶対パスを使用してみました。CMSSelectDegreeLevelPlugin で render メソッドをオーバーライドしようとしました。
私は明らかな何かを見落としていますか?私は以前に(django-cmsの異なるバージョンで)非常によく似たプラグインを作成しましたが、問題はありませんでした。
models.py:
from cms.models.pluginmodel import CMSPlugin
from django.db import models
class SelectDegreeLevel(CMSPlugin):
degree_level = models.CharField('Degree Level', max_length=50)
cms-plugins.py
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.utils.translation import gettext_lazy as _
from models import SelectDegreeLevel
class CMSSelectDegreeLevelPlugin(CMSPluginBase):
model = SelectDegreeLevel
name = _('Degree Level')
render_template = "cms/plugins/select_degree_level.html"
plugin_pool.register_plugin(CMSSelectDegreeLevelPlugin)
select_degree_level.html
<h1>static text test {{ instance.degree_level }}</h1>