Configuring autogrow plugin with djangocms-text-ckeditor - django-cms

I am trying to use the autogrow plugin for ckeditor. As I am new to django and ckeditor I am having trouble with configuration. My settings are not being recognized. Below is a list of steps. I have seen reference to having to build ckeditor over again. I do not know if this is needed.
Platform: Ubuntu, django-cms 3 beta, djangocms-text-ckeditor (installed used pip in virtualenv), python 2.7.
I do not know exactly what I need to do, but I changed the following anyway.
S1. In project's settings.py, added
CKEDITOR_SETTINGS = getattr(settings, 'CKEDITOR_SETTINGS', {
'config.autoGrow_onStartup': True,
'config.autoGrow_minHeight': 200,
'config.autoGrow_maxHeight': 400,
})
S2. In ../site-packages/django_text_ckeditor/static/ckeditor/config.js, edited
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.autoGrow_onStartup = true;
config.autoGrow_minHeight = 2000;
config.autoGrow_maxHeight = 4000;
};
S3. Added the autogrow plugin folder to
"../site-packages/django_text_ckeditor/static/ckeditor/plugins/autogrow"
S4. Modified line 45 of
"../site-packages/django_text_ckeditor/static/js/cms.ckeditor.js"
'extraPlugins': 'cmsplugins, autogrow'
S5. Added an extra statement after line 58 of
"../site-packages/django_text_ckeditor/static/js/cms.ckeditor.js"
// this is line 58
CKEDITOR.plugins.addExternal('cmsplugins', settings.static_url + 'ckeditor_plugins/cmsplugins/');
// this is the added line
CKEDITOR.plugins.addExternal('autogrow', settings.static_url + 'ckeditor/plugins/autogrow');
Do not know what else to do? Thoughts? Advice?

I'am using standard django-ckeditor from here: https://github.com/django-ckeditor/django-ckeditor
Your Step S2 and S4 and S5 are not needed. It makes no sens to modify the source of ckeditor. Just download the autogrow plugin from http://ckeditor.com/addon/autogrow and config with settings.py:
CKEDITOR_CONFIGS = {
'default': {
'autoGrow_onStartup': True,
'autoGrow_minHeight': 100,
'autoGrow_maxHeight': 650,
'extraPlugins': 'autogrow',
'toolbar': 'Custom',
'toolbar_Custom': [
['Bold', 'Italic', 'Underline'],
['Format'],
#['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Link', 'Unlink'],
['RemoveFormat', 'Source']
],
}
}

Related

how to exclude files with postcss 8

I am using tailwindcss with postcss8 (it comes with tailwind) and there is a problem trying to parse a css from a node_modules package.
is there a way to exclude these css files from being processed by postcss?
this is the error I get:
ERROR in ./node_modules/#fullcalendar/common/main.css (./node_modules/#nuxt/postcss8/node_modules/css-loader/dist/cjs.js??ref--3-oneOf-1-1!./node_modules/#nuxt/postcss8/node_modules/postcss-loader/dist/cjs.js??ref--3-oneOf-1-2!./node_modules/#fullcalendar/common/main.css)
Module build failed (from ./node_modules/#nuxt/postcss8/node_modules/postcss-loader/dist/cjs.js):
ParserError: Syntax Error at line: 1, column 45
at /Users/ctw/Sites/github/escience/WoSSS/website/node_modules/#fullcalendar/common/main.css:633:3
at Parser.error (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/postcss-values-parser/lib/parser.js:127:11)
at Parser.operator (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/postcss-values-parser/lib/parser.js:162:20)
at Parser.parseTokens (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/postcss-values-parser/lib/parser.js:245:14)
at Parser.loop (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/postcss-values-parser/lib/parser.js:132:12)
at Parser.parse (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/postcss-values-parser/lib/parser.js:51:17)
at parse (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/postcss-custom-properties/index.cjs.js:47:30)
at /Users/ctw/Sites/github/escience/WoSSS/website/node_modules/postcss-custom-properties/index.cjs.js:333:24
at /Users/ctw/Sites/github/escience/WoSSS/website/node_modules/#nuxt/postcss8/node_modules/postcss/lib/container.js:72:18
at /Users/ctw/Sites/github/escience/WoSSS/website/node_modules/#nuxt/postcss8/node_modules/postcss/lib/container.js:55:18
at Rule.each (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/#nuxt/postcss8/node_modules/postcss/lib/container.js:41:16)
at Rule.walk (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/#nuxt/postcss8/node_modules/postcss/lib/container.js:52:17)
at /Users/ctw/Sites/github/escience/WoSSS/website/node_modules/#nuxt/postcss8/node_modules/postcss/lib/container.js:60:24
at Root.each (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/#nuxt/postcss8/node_modules/postcss/lib/container.js:41:16)
at Root.walk (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/#nuxt/postcss8/node_modules/postcss/lib/container.js:52:17)
at Root.walkDecls (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/#nuxt/postcss8/node_modules/postcss/lib/container.js:70:19)
at transformProperties (/Users/ctw/Sites/github/escience/WoSSS/website/node_modules/postcss-custom-properties/index.cjs.js:330:8)
# ./node_modules/#fullcalendar/common/main.css 4:14-191
# ./node_modules/#fullcalendar/common/main.js
# ./node_modules/#fullcalendar/timegrid/main.js
# ./node_modules/babel-loader/lib??ref--2-0!./node_modules/#nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/global/Schedule.vue?vue&type=script&lang=js&
# ./components/global/Schedule.vue?vue&type=script&lang=js&
# ./components/global/Schedule.vue
# ./node_modules/.cache/nuxt/components/index.js
# ./node_modules/.cache/nuxt/components/plugin.js
# ./node_modules/.cache/nuxt/index.js
# ./node_modules/.cache/nuxt/client.js
# multi ./node_modules/#nuxt/components/lib/installComponents.js ./node_modules/.cache/nuxt/client.js
I also had this issue. However, this is how I solve it.
Add the following to your nuxt.config.js file.
build: {
postcss: {
plugins: {
/**
* do not remove the cssnano key.
* (https://github.com/fullcalendar/fullcalendar/issues/5503)
*/
cssnano: {
preset: [
'default',
{
calc: false,
},
],
},
},
},
transpile: [
/#fullcalendar.*/, // always need for fullcalenar
],
},
To learn more about it, read this processing css with postcss, calc/var problems.
I hope this helps you. If you have solved this, please share your solution so that the community can learn from it.

cx_freeze include css file and image in dash app

I have some difficulties to apply a css file to my dash app when using cx_freeze. If I run python app.py the layout is properly applied, however not if I am executing the .exe generated by cx_freeze. Then the default html layout is displayed. The css and the image appear in the same directory where the .exe is located.
This is how my setup.py looks like.
from setuptools import find_packages
from cx_Freeze import setup, Executable
options = {
'build_exe': {
'includes': [
'cx_Logging', 'idna', 'idna.idnadata'
],
'packages': [
'asyncio', 'flask', 'jinja2', 'dash', 'plotly', 'waitress'
],
'excludes': ['tkinter'],
'include_files': [
'assets/logo.jpg', 'assets/style.css'
],
}
}
executables = [
Executable('server.py',
base='console',
targetName='dash_app.exe')
]
setup(
name='BI_Report',
packages=find_packages(),
version='0.0.1',
description='rig',
executables=executables,
options=options
)
To load the external files I use a helper function as suggested here:
def find_data_file(filename):
if getattr(sys, 'frozen', False):
# The application is frozen
datadir = os.path.dirname(sys.executable)
else:
# The application is not frozen
# Change this bit to match where you store your data files:
datadir = os.path.dirname(__file__)
return os.path.join(datadir, filename)
app = dash.Dash(__name__,
assets_folder=find_data_file('assets/'))
I am using:
Python 3.7.6
dash 1.9.1
cx-freeze 6.1
Any help much appreciated!

Customizing css file in django-oscar using less

I am fairly new to django oscar and only have basic understanding of website front end.
I want to change the styles.css in django oscar. I have tried to change directly in styles.css but somehow when I refresh the localhost detects no changes (default css).
I've tried to change the less file, install npm, install less and change the setting into OSCAR_USE_LESS = True. The localhost didn't even render the css file at all, only the template.
When I write the command make css in root directory, following error occurred even though I've installed less.
make: *** No rule to make target `css'. Stop.
so I really don't know what is wrong with my setting or installed apps.
Settings are
import os
import oscar
# Path helper - going into /Users/dion/Dev/dioncoffee/x
location = lambda x: os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__file__))), x)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '=%*t%wzzw^hs5l2o#oq2ae-*&wde0bko4!hxl%=uqb$!5po$tt'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
from oscar import get_core_apps
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.flatpages',
'django_extensions',
'compressor',
#'apps.gateway', # For allowing dashboard access
'widget_tweaks',
] + get_core_apps(
['apps.promotions']
)
SITE_ID = 1
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'oscar.apps.basket.middleware.BasketMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
]
ROOT_URLCONF = 'dioncoffee.urls'
from oscar import OSCAR_MAIN_TEMPLATE_DIR
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
location('dioncoffee/templates'),
oscar.OSCAR_MAIN_TEMPLATE_DIR,
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.i18n',
'django.contrib.messages.context_processors.messages',
'oscar.apps.search.context_processors.search_form',
'oscar.apps.promotions.context_processors.promotions',
'oscar.apps.checkout.context_processors.checkout',
'oscar.apps.customer.notifications.context_processors.notifications',
'oscar.core.context_processors.metadata',
],
},
},
]
WSGI_APPLICATION = 'dioncoffee.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'dioncoffee',
'USER': 'dion',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '',
}
}
# Password validation
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
AUTHENTICATION_BACKENDS = (
'oscar.apps.customer.auth_backends.EmailBackend',
'django.contrib.auth.backends.ModelBackend',
)
# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
},
}
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = location("public/media")
STATIC_ROOT = location('public/static')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'
STATIC_URL = '/static/'
# /Users/dion/Dev/dioncoffee/static/
STATICFILES_DIRS = (
location('static'),
)
from oscar.defaults import *
OSCAR_DEFAULT_CURRENCY = 'EUR'
OSCAR_CURRENCY_FORMAT = {
'USD': {
'currency_digits': False,
'format_type': "accounting",
},
'EUR': {
'format': u'#,##0\xa0ยค',
}
}
USE_LESS = True
COMPRESS_ENABLED = False
COMPRESS_PRECOMPILERS = (
('text/less', 'lessc {infile} {outfile}'),
)
COMPRESS_OFFLINE_CONTEXT = {
'STATIC_URL': 'STATIC_URL',
'use_less': USE_LESS,
}
My directory files
And I am using python 3.6.5.
make css is intended only for development on Oscar itself - it will not work in your project. I can't see why the USE_LESS approach would fail if you are in debug mode though.
That said, I think you are better off overriding the CSS rather than relying on USE_LESS which is likely to be removed completely in the future, and is only really intended for development.
You should be able to override the CSS if you are putting in the right place.
If you have your CSS inside an app, then it needs to go inside app_dir/static/oscar/css/style.css and you need to have 'django.contrib.staticfiles.finders.AppDirectoriesFinder' in the STATICFILES_FINDERS setting.
Alternatively if you have a separate directory for static files then you need to include 'django.contrib.staticfiles.finders.FileSystemFinder' in the setting, and also specify STATICFILES_DIRS to tell Django where this directory is.

cocoapods dylib dependency use_frameworks

I have built a dynamic library (to add ICU support in this case) which i need to add as a dependency to a pod. For that I created a pod with the following podspec (I removed things like authors, license, ... to keep it short)
Pod::Spec.new do |s|
s.name = 'unicode'
s.version = '57.0'
s.source = { :git => "git#bitbucket.org:mycompany/unicode.git", :tag => "#{s.version}" }
s.requires_arc = false
s.platform = :ios, '8.0'
s.default_subspecs = 'all'
s.subspec 'all' do |ss|
ss.header_mappings_dir = 'icu4c/include'
ss.source_files = 'icu4c/include/**/*.h'
ss.public_header_files = 'icu4c/include/**/*.h'
ss.vendored_libraries = 'Frameworks/lib*.dylib'
end
end
Here i have a second pod where i need to link these libraries too
Pod::Spec.new do |s|
s.name = 'sqlite3'
s.version = '3.14.2'
s.summary = 'SQLite is an embedded SQL database engine'
s.documentation_url = 'https://sqlite.org/docs.html'
s.homepage = 'https://github.com/clemensg/sqlite3pod'
s.authors = { 'Clemens Gruber' => 'clemensgru#gmail.com' }
v = s.version.to_s.split('.')
archive_name = "sqlite-amalgamation-"+v[0]+v[1].rjust(2, '0')+v[2].rjust(2, '0')+"00"
#s.source = { :http => "https://www.sqlite.org/#{Time.now.year}/#{archive_name}.zip" }
s.source = { :git => "git#bitbucket.org:wrthphoenixspeedy/sqlite3.git", :tag => "#{s.version}" }
s.requires_arc = false
s.platform = :ios, '8.0'
s.default_subspecs = 'common'
s.subspec 'common' do |ss|
ss.source_files = "#{archive_name}/sqlite*.{h,c}"
ss.osx.pod_target_xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DHAVE_USLEEP=1' }
# Disable OS X / AFP locking code on mobile platforms (iOS, tvOS, watchOS)
sqlite_xcconfig_ios = { 'OTHER_CFLAGS' => '$(inherited) -DHAVE_USLEEP=1 -DSQLITE_ENABLE_LOCKING_STYLE=0' }
ss.ios.pod_target_xcconfig = sqlite_xcconfig_ios
ss.tvos.pod_target_xcconfig = sqlite_xcconfig_ios
ss.watchos.pod_target_xcconfig = sqlite_xcconfig_ios
end
# enable support for icu - International Components for Unicode
s.subspec 'icu' do |ss|
ss.dependency 'sqlite3/common'
ss.pod_target_xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DSQLITE_ENABLE_ICU=1' }
ss.dependency 'unicode', '57.0'
ss.libraries = 'icucore', 'icudata.57.1', 'icui18n.57.1', 'icuio.57.1', 'icule.57.1', 'iculx.57.1', 'icutu.57.1', 'icuuc.57.1'
end
end
And with these i am able to compile it. Cocoapods is copying these libraries on build time into the folder ../Frameworks/ rather than to do while on run time. Instead it fails because it says that it doesn't find the library in ../lib.
dyld: Library not loaded: ../lib/libicudata.57.1.dylib
Referenced from: /var/containers/Bundle/Application/9663CB3A-6ACD-487E-A92D-48F8AFE5260C/MyApp.app/MyApp
Reason: image not found
I have to use use_frameworks! because i am using some Swift frameworks too.
So i am doing something wrong... the question is, can i link a dylib from one pod to another pod? and if so... how?
Based on the disparity between "libs" and "Frameworks", this looks like an issue with either runpath search paths (the running app is not looking for the library from Frameworks), or with the install name of the library not matching the location where it's placed relative to where it is dynamically loaded from.
Make sure that in the app that bundles the dynamic library you have the following paths included in your "Runpath Search Path": #executable_path/../Frameworks, #loader_path/../Frameworks
Make sure that the "Dynamic Library Install Name" name of the library being loaded is set to the equivalent of #rpath/$(EXECUTABLE_PATH) (i.e. in your case it should be "#rpath/libicudata.57.1.dylib"). You can set it during build time using the -install_name compiler (linker?) flag, or with install_name_tool, like so: install_name_tool -id "#rpath/libicudata.57.1.dylib" libicudata.57.1.dylib . Hopefully doesn't come to this though.

Django CMS pages not visible after server restart

I've been using django-cms to build a simple website for my GF. I was editing the base template and for some reason my changes were not going through, so I restarted the nginx server script only to find out to my horror, that I can't see any of the page content anymore, only their names in the tree in the admin interface. If I try to go to a page, it claims the page does not exist.
I thought maybe there is something wrong with the setup so I ran fix-tree and migrate (which might have been an error on my part) and now even the page names are not visible anymore in the admin interface. The pages and their contents are in the database, but they are not accessible anymore.
Has anyone run into a similar issue? What could be a possible cause / solution for this? Any ideas where to look
My guess is that something was wrong with the setup or perhaps I had a wrong version of some package and then I didn't run into trouble until I restarted.
I would love to have all those pages back especially that they still exist in the DB. Will be eternally grateful for any help.
EDIT
I just tried creating a new page. I was able to do this without any errors, the page is visible in the database but it is not visible in on the "Pages" page and the page slug gives an 404 error.
EDIT 2
Here's the requirements.txt
aldryn-apphooks-config==0.2.7
aldryn-boilerplates==0.7.4
aldryn-bootstrap3==1.0.10
aldryn-categories==1.0.3
aldryn-common==1.0.4
aldryn-newsblog==1.2.4
aldryn-people==1.2.1
aldryn-reversion==1.0.9
aldryn-style==1.1.1
aldryn-translation-tools==0.2.1
aldryn-video==1.0.0
Babel==2.3.4
backport-collections==0.1
beautifulsoup4==4.4.1
dj-database-url==0.4.1
Django==1.8.15
django-appconf==1.0.2
django-appdata==0.1.5
django-classy-tags==0.8.0
django-cms==3.2.5
django-durationfield==0.5.2
django-filer==1.2.4
django-formtools==1.0
django-mptt==0.8.6
django-parler==1.6.5
django-phonenumber-field==1.1.0
django-polymorphic==0.8.1
django-reversion==1.8.7
django-sekizai==0.10.0
Django-Select2==4.3.2
django-sortedm2m==1.3.2
django-taggit==0.21.2
django-treebeard==4.0.1
djangocms-admin-style==1.2.3
djangocms-attributes-field==0.1.1
djangocms-column==1.6.0
djangocms-file==1.0
djangocms-googlemap==0.5.1
djangocms-inherit==0.2.1
djangocms-installer==0.8.7
djangocms-link==1.8.2
djangocms-picture==0.2.0
djangocms-style==1.7.0
djangocms-teaser==0.2.0
djangocms-text-ckeditor==3.1.0
djangocms-video==1.0.0
easy-thumbnails==2.3
gevent==1.1rc3
greenlet==0.4.9
gunicorn==18.0
html5lib==0.9999999
jsonfield==1.0.3
lxml==3.6.4
micawber==0.3.3
phonenumbers==7.5.2
phonenumberslite==7.5.2
Pillow==3.3.1
psycopg2==2.6.1
python-dateutil==2.5.3
python-slugify==1.2.0
pytz==2016.6.1
six==1.10.0
tzlocal==1.2.2
Unidecode==0.4.19
virtualenv==15.0.1
webencodings==0.5
YURL==0.13
And here's the settings file:
import os
gettext = lambda s: s
DATA_DIR = os.path.dirname(os.path.dirname(__file__))
"""
Django settings for anninsivut project.
Generated by 'django-admin startproject' using Django 1.8.14.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'VERY SECRET'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['.site.com', ]
# Application definition
ROOT_URLCONF = 'anninsivut.urls'
WSGI_APPLICATION = 'anninsivut.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/
LANGUAGE_CODE = 'en'
TIME_ZONE = 'Europe/Amsterdam'
USE_I18N = False
USE_L10N = False
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(DATA_DIR, 'anninsivut', 'media')
STATIC_ROOT = os.path.join(DATA_DIR, 'anninsivut', 'static')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'anninsivut', 'common_static'),
)
SITE_ID = 1
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'anninsivut', 'templates'), ],
'OPTIONS': {
'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',
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader',
'aldryn_boilerplates.template_loaders.AppDirectoriesLoader',
],
},
},
]
MIDDLEWARE_CLASSES = (
# 'cms.middleware.utils.ApphookReloadMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware'
)
INSTALLED_APPS = (
'djangocms_admin_style',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'cms',
'menus',
'sekizai',
'treebeard',
'djangocms_text_ckeditor',
'djangocms_style',
'djangocms_column',
'djangocms_file',
'djangocms_googlemap',
'djangocms_inherit',
'djangocms_link',
'djangocms_picture',
'djangocms_teaser',
'aldryn_video',
'reversion',
'aldryn_apphooks_config',
'aldryn_boilerplates',
'aldryn_categories',
'aldryn_common',
'aldryn_translation_tools',
'aldryn_newsblog',
'aldryn_people',
'aldryn_reversion',
'aldryn_bootstrap3',
'parler',
'sortedm2m',
'taggit',
'easy_thumbnails',
'filer',
'anninsivut'
)
LANGUAGES = (
## Customize this
('en', gettext('en')),
)
ALDRYN_BOILERPLATE_NAME = 'bootstrap3'
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'aldryn_boilerplates.staticfile_finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]
CMS_LANGUAGES = {
## Customize this
1: [
{
'name': gettext('en'),
'redirect_on_fallback': True,
'code': 'en',
'public': True,
'hide_untranslated': False,
},
],
'default': {
'redirect_on_fallback': True,
'hide_untranslated': False,
'public': True,
},
}
THUMBNAIL_PROCESSORS = (
'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop',
# 'easy_thumbnails.processors.scale_and_crop', # disable this one
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters',
)
CMS_TEMPLATES = (
## Customize this
('page.html', 'Page'),
('feature.html', 'Page with Feature')
)
CMS_PERMISSION = True
CMS_PLACEHOLDER_CONF = {}
DATABASES = {
'default': {
'CONN_MAX_AGE': 0,
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': 'localhost',
'NAME': 'anninsivut_DB',
'PASSWORD': 'password',
'PORT': '',
'USER': 'user'
}
}
DEFAULT_FROM_EMAIL = 'name#domain.com'
SERVER_EMAIL = 'name#domain.com'
ADMINS = (
('Your name', 'your email address'),
)
MIGRATION_MODULES = {
}
#Paulo Thanks for asking for these. Now that I looked at the requirements and settings file, I see that the requirements file I had on my local Pycharm dir had not synced with the one on the server. At some point I must've accidentally upgraded to Django 1.9 in the venv of the server. Now I guess that when I restarted that's when the Django-CMS picked up the change and lost the page contents. Then when I saw the loss and downgraded back to 1.8, that's when I lost the page names as well on the pages tree. I'll start by going through the changes between the two and also see if the packages are up to date with what they should be.
OK I managed to fix. After stepping through the code in the debugger in Pycharm, I realized I accidentally commented out the
LANGUAGE_CODE = 'en'
line in settings with made Django revert back to LANGUAGE_CODE = 'en-us', and that why it couldn't find the pages.
I also had a syncing problem between PyCharm and the deployment server, which is why the LANGUAGE_CODE = 'en' was not commented out in the settings.py I posted here.
So in short:
TIL that the language code must match in both
LANGUAGE_CODE = 'en'
and
CMS_LANGUAGES = {
1: [
{
'name': gettext('en'),
'redirect_on_fallback': True,
'code': 'en',
'public': True,
'hide_untranslated': False,
},
],
'default': {
'redirect_on_fallback': True,
'hide_untranslated': False,
'public': True,
},
}

Resources