Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davekennewell/d4f99670396707f9ec9ec2c9636ddc08 to your computer and use it in GitHub Desktop.
Save davekennewell/d4f99670396707f9ec9ec2c9636ddc08 to your computer and use it in GitHub Desktop.
Geonode & DjangoCMS settings
INSTALLED_APPS = (
'modeltranslation',
'djangocms_admin_style', # for the admin skin. You **must** add 'djangocms_admin_style' in the list **before** 'django.contrib.admin'.
# Boostrap admin theme
# 'django_admin_bootstrapped.bootstrap3',
# 'django_admin_bootstrapped',
# Apps bundled with Django
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'django.contrib.humanize',
'django.contrib.gis',
# Utility
'pagination',
'taggit',
'friendlytagloader',
'geoexplorer',
'leaflet',
'django_extensions',
# 'haystack',
'autocomplete_light',
'mptt',
#'modeltranslation',
'djcelery',
'storages',
# Theme
"pinax_theme_bootstrap_account",
"pinax_theme_bootstrap",
'django_forms_bootstrap',
# Social
'account',
'avatar',
'dialogos',
'agon_ratings',
#'notification',
'announcements',
'actstream',
'user_messages',
'tastypie',
'polymorphic',
'guardian',
# GeoNode internal apps
'geonode.people',
'geonode.base',
'geonode.layers',
'geonode.maps',
'geonode.proxy',
'geonode.security',
'geonode.social',
'geonode.catalogue',
'geonode.documents',
'geonode.api',
'geonode.groups',
'geonode.services',
# DjangoCMS apps
'cms', # django CMS itself
'treebeard', # utilities for implementing a tree
'menus', # helper for model independent hierarchical website navigation
'sekizai', # for JavaScript and CSS management
'djangocms_text_ckeditor',
'djangocms_column',
'djangocms_table',
'filer',
'easy_thumbnails',
'cmsplugin_filer_file',
'cmsplugin_filer_folder',
'cmsplugin_filer_link',
'cmsplugin_filer_image',
'cmsplugin_filer_teaser',
'cmsplugin_filer_video',
'djangocms_inherit',
'reversion',
'aldryn_style',
'aldryn_bootstrap3',
#'cfm',
#'cfm.apps.geonode_cms_map'
# GeoNode Contrib Apps
# 'geonode.contrib.dynamic',
# 'geonode.contrib.exif',
# 'geonode.contrib.favorite',
# 'geonode.contrib.geogig',
# 'geonode.contrib.geosites',
# 'geonode.contrib.nlp',
# 'geonode.contrib.slack',
# 'geonode.contrib.metadataxsl',
# GeoServer Apps
# Geoserver needs to come last because
# it's signals may rely on other apps' signals.
'geonode.geoserver',
'geonode.upload',
'geonode.tasks'
)
MIDDLEWARE_CLASSES = (
'cms.middleware.utils.ApphookReloadMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# The setting below makes it possible to serve different languages per
# user depending on things like headers in HTTP requests.
'django.middleware.locale.LocaleMiddleware',
'pagination.middleware.PaginationMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
# This middleware allows to print private layers for the users that have
# the permissions to view them.
# It sets temporary the involved layers as public before restoring the permissions.
# Beware that for few seconds the involved layers are public there could be risks.
# 'geonode.middleware.PrintProxyMiddleware',
# DjangoCMS Middleware
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware',
)
# Note that Django automatically includes the "templates" dir in all the
# INSTALLED_APPS, so there is no need to add maps/templates or admin/templates
# TEMPLATE_DIRS = (
# os.path.join(LOCAL_ROOT, "templates"),
# ) + TEMPLATE_DIRS
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'DIRS': [os.path.join(LOCAL_ROOT, "templates"),os.path.join(PROJECT_ROOT, "templates"),],
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.tz',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.core.context_processors.request',
'django.contrib.messages.context_processors.messages',
'account.context_processors.account',
# The context processor below adds things like SITEURL
# and GEOSERVER_BASE_URL to all pages that use a RequestContext
'geonode.context_processors.resource_urls',
'geonode.geoserver.context_processors.geoserver_urls',
'sekizai.context_processors.sekizai',
'cms.context_processors.cms_settings',
],
},
},
]
CMS_TEMPLATES = (
('home.html', 'Home'),
('projects_home.html', 'ProjectsHome'),
('project_page.html', 'ProjectPage'),
('standard_page.html', 'StandardPage')
)
MIGRATION_MODULES = {
'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django',
'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django',
'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django',
'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django',
'djangocms_table': 'djangocms_table.migrations_django'
}
THUMBNAIL_PROCESSORS = (
'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop',
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters'
)
LANGUAGES = (
## Customize this
('en', gettext('en')),
('hi', gettext('hi')),
)
CMS_LANGUAGES = {
## Customize this
'default': {
'public': True,
'hide_untranslated': False,
'redirect_on_fallback': True,
},
1: [
{
'public': True,
'code': 'en',
'hide_untranslated': False,
'name': gettext('en'),
'redirect_on_fallback': True,
},
{
'public': True,
'code': 'hi',
'hide_untranslated': False,
'name': gettext('hi'),
'redirect_on_fallback': True,
},
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment