Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

ImproperlyConfigured: CMS Plugins must define a render template #167

Closed
stalsbyt opened this issue Apr 9, 2015 · 8 comments
Closed

ImproperlyConfigured: CMS Plugins must define a render template #167

stalsbyt opened this issue Apr 9, 2015 · 8 comments

Comments

@stalsbyt
Copy link

stalsbyt commented Apr 9, 2015

after install and configure i try to start test server (python manage.py runserver)
and i got:
ImproperlyConfigured: CMS Plugins must define a render template (<class 'aldryn_newsblog.cms_plugins.NewsBlogArchivePlugin'>) that exists: aldryn_newsblog/plugins/archive.html
after comment it in settings.py -
ImproperlyConfigured: CMS Plugins must define a render template (<class 'aldryn_people.cms_plugins.PeoplePlugin'>) that exists: aldryn_people/plugins/standard/people_list.html

@vinitkumar
Copy link

I got this issue too. The problem is with the https://pypi.python.org/pypi/aldryn-boilerplates/ configuration. Even after following the guidelines in the project. I still get the same error. One quick fix is to the copy the templates directory directly to your project's template directory.

@mkoistinen
Copy link
Contributor

I cannot reproduce this issue locally. Have you both followed the directions on the boilerplates repo: https://github.com/aldryn/aldryn-boilerplates/?

@vinitkumar
Copy link

@mkoistinen I am running cms v3.0.12 and django 1.6.11.
Here is my template context processor:

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages',
    'django.core.context_processors.i18n',
    'django.core.context_processors.debug',
    'django.core.context_processors.request',
    'django.core.context_processors.media',
    'django.core.context_processors.csrf',
    'django.core.context_processors.tz',
    'sekizai.context_processors.sekizai',
    'django.core.context_processors.static',
    'cms.context_processors.cms_settings',
    'aldryn_boilerplates.context_processors.boilerplate',
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'aldryn_boilerplates.staticfile_finders.AppDirectoriesFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',

#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'aldryn_boilerplates.template_loaders.AppDirectoriesLoader',
    'django.template.loaders.app_directories.Loader',

#     'django.template.loaders.eggs.Loader',
)

# Installed apps:

INSTALLED_APPS = (
    'djangocms_admin_style',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'django.contrib.admindocs',
    'django.contrib.redirects',


    'cms',
    'menus',
    'mptt',
    'sekizai',

    'djangocms_text_ckeditor',
    'djangocms_style',
    'djangocms_column',
    'djangocms_file',
    'djangocms_inherit',
    'djangocms_link',
    'djangocms_picture',
    'djangocms_googlemap',
    'djangocms_snippet',
    'cmsplugin_twitter',

    'aldryn_apphooks_config',
    'aldryn_boilerplates',
    'aldryn_categories',
    'cmsplugin_filer_image',
    'aldryn_newsblog',
    'aldryn_people',
    'aldryn_reversion',
    'easy_thumbnails',
    'filer',
    'parler',
    'reversion',
    'taggit',
    'sortedm2m',


    'socialschools_site.apps.cmsplugin_demo',
    'socialschools_site.apps.cmsplugin_question',
    'socialschools_site.apps.cmsplugin_price',
    'socialschools_site.apps.cmsplugin_feature',
    'socialschools_site.apps.cmsplugin_testimonial',
    'socialschools_site.apps.cmsplugin_faq',
    'socialschools_site',
    'pygeoip',
    'socialschools_site.apps.geoip_redir',
    'south',
)

@mkoistinen
Copy link
Contributor

What about this:

ALDRYN_BOILERPLATE_NAME = 'bootstrap3'

@racamirko
Copy link

I get the same problem, with Django 1.7.0 and CMS 3.1.2. I do have the

ALDRYN_BOILERPLATE_NAME = 'bootstrap3'

line in my config. Has this been solved or just abandoned?

@bitzip
Copy link

bitzip commented Aug 24, 2015

+1

@mkoistinen
Copy link
Contributor

@racamirko, @kelly-apollo, this was closed, because its not a real issue.

You have to do more than just put ALDRYN_BOILERPLATE_NAME = 'bootstrap3' in your settings. You must also properly install aldryn-boilerplates. This includes entries in TEMPLATE_CONTEXT_PROCESSORS, STATICFILES_FINDERS, TEMPLATE_LOADERS, and INSTALLED_APPS sections of your settings. Please confirm you've done this and report back. If there is still an issue, we can re-open this.

@dmk12
Copy link

dmk12 commented Feb 4, 2016

It's not immediately clear from the official documentation that additional configuration of aldryn-boilerplates is needed in order for the installation to work, even though it is mentioned in the docs and a link is provided, but the mention is so brief that it's easily overlooked.

Perhaps it would be a good idea to include the following text snippet along with the link:

Configuration

Django 1.5 - 1.7

INSTALLED_APPS = [
    ...
    'aldryn_boilerplates',
    ...
]

TEMPLATE_CONTEXT_PROCESSORS = [
    ...
    'aldryn_boilerplates.context_processors.boilerplate',
]

STATICFILES_FINDERS = [
    'django.contrib.staticfiles.finders.FileSystemFinder',
    # important! place right before django.contrib.staticfiles.finders.AppDirectoriesFinder
    'aldryn_boilerplates.staticfile_finders.AppDirectoriesFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]

TEMPLATE_LOADERS = [
    'django.template.loaders.filesystem.Loader',
    # important! place right before django.template.loaders.app_directories.Loader
    'aldryn_boilerplates.template_loaders.AppDirectoriesLoader',
    'django.template.loaders.app_directories.Loader',
]

Now set the name of the Boilerplate you want to use in your project:

ALDRYN_BOILERPLATE_NAME = 'bootstrap3'

Django 1.8+

In general configuration stays the same but you should respect changes that were introduced by django 1.8. In particular in Django 1.8 context processors were moved from django.core to django.template.

Be sure to include aldryn_boilerplates to INSTALLED_APPS, adjust STATICFILES_FINDERS and finally configure TEMPLATES.

For TEMPLATES you need to add aldryn_boilerplates.context_processors.boilerplate to context_processors and alter loaders in the same way as we do it for Django versions prior to 1.8.

Note that in the example below we are altering the default values, so if you are using something that is custom - don't forget to add that too.

Here is an example of a simple configuration:

INSTALLED_APPS = [
    ...
    'aldryn_boilerplates',
    ...
]

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'aldryn_boilerplates.staticfile_finders.AppDirectoriesFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'OPTIONS': {
            'context_processors': [
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django.template.context_processors.i18n',
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.template.context_processors.media',
                'django.template.context_processors.csrf',
                'django.template.context_processors.tz',
                'sekizai.context_processors.sekizai',
                'django.template.context_processors.static',
                'cms.context_processors.cms_settings',
                'aldryn_boilerplates.context_processors.boilerplate',
            ],
            'loaders': [
                'django.template.loaders.filesystem.Loader',
                'aldryn_boilerplates.template_loaders.AppDirectoriesLoader',
                'django.template.loaders.app_directories.Loader',
            ],
        },
    },
]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants