Code Monkey home page Code Monkey logo

Comments (8)

dmk12 avatar dmk12 commented on July 27, 2024 1

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',
            ],
        },
    },
]

from aldryn-newsblog.

vinitkumar avatar vinitkumar commented on July 27, 2024

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.

from aldryn-newsblog.

mkoistinen avatar mkoistinen commented on July 27, 2024

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

from aldryn-newsblog.

vinitkumar avatar vinitkumar commented on July 27, 2024

@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',
)

from aldryn-newsblog.

mkoistinen avatar mkoistinen commented on July 27, 2024

What about this:

ALDRYN_BOILERPLATE_NAME = 'bootstrap3'

from aldryn-newsblog.

racamirko avatar racamirko commented on July 27, 2024

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?

from aldryn-newsblog.

bitzip avatar bitzip commented on July 27, 2024

+1

from aldryn-newsblog.

mkoistinen avatar mkoistinen commented on July 27, 2024

@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.

from aldryn-newsblog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.