[SOLVED] TemplateSyntaxError when tried to manage page on Django admin backend – Stack Overflow

Issue

This Content is from Stack Overflow. Question asked by Rosidin Bima

I am new on Django CMS and i have experience with error when try to add a page or page type trough backend site. Below is the error i got.

I am using Django 4.1.1 version, Django-cms 3.11.0.

Any help or suggestion will be appreciated.

    TemplateSyntaxError at /admin/cms/pagetype/add/
Invalid block tag on line 101: 'page_submit_row', expected 'endif'. Did you forget to register or load this tag?
Request Method: GET
Request URL:    http://localhost:8000/admin/cms/pagetype/add/
Django Version: 4.1.1
Exception Type: TemplateSyntaxError
Exception Value:    
Invalid block tag on line 101: 'page_submit_row', expected 'endif'. Did you forget to register or load this tag?
Exception Location: C:project_datapythonmyblogenvlibsite-packagesdjangotemplatebase.py, line 557, in invalid_block_tag
Raised during:  cms.admin.pageadmin.add_view
Python Executable:  C:project_datapythonmyblogenvScriptspython.exe
Python Version: 3.10.7
Python Path:    
['C:\project_data\python\myblog\myblog',
 'C:\Program '
 'Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64__qbz5n2kfra8p0\python310.zip',
 'C:\Program '
 'Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64__qbz5n2kfra8p0\DLLs',
 'C:\Program '
 'Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64__qbz5n2kfra8p0\lib',
 'C:\Users\Rosidin\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0',
 'C:\project_data\python\myblog\env',
 'C:\project_data\python\myblog\

and here is my settings.py

SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'django-insecure-rt-cu)&d604(@1pmfi!@z^_etwo(jvm!k#&z3&yxb62ll+gz1#'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
X_FRAME_OPTIONS = 'SAMEORIGIN'
SITE_ID = 1

# Application definition

INSTALLED_APPS = [
    'djangocms_admin_style',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'simpleblog',
    'sekizai',
    'django.contrib.sites',
    'cms',
    'menus',
    'treebeard',
]

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',
    'cms.middleware.user.CurrentUserMiddleware',
    'cms.middleware.page.CurrentPageMiddleware',
    'cms.middleware.toolbar.ToolbarMiddleware',
    'cms.middleware.language.LanguageCookieMiddleware',
    'cms.middleware.utils.ApphookReloadMiddleware',
    'django.middleware.locale.LocaleMiddleware',
]

ROOT_URLCONF = 'myblog.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'sekizai.context_processors.sekizai',
                'cms.context_processors.cms_settings',
                'django.template.context_processors.i18n',
            ],
        },
    },
]

WSGI_APPLICATION = 'myblog.wsgi.application'


# Database

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'myblog',
        'USER': 'root',
        'PASSWORD': '',
        'HOST': '127.0.0.1',
        'PORT': '3306',
    }
}


# Password validation

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


# Internationalization

LANGUAGE_CODE = 'en'
LANGUAGES = [
    ('en', 'English'),
    ('de', 'German'),
]

TIME_ZONE = 'UTC'

USE_I18N = False

USE_TZ = True


# Static files (CSS, JavaScript, Images)

STATIC_URL = 'static/'

# Default primary key field type

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'



Solution

Django CMS 3.11.0 does not support Django 4.1 yet. Please downgrade to Django 4.0 (or LTS 3.2).


This Question was asked in StackOverflow by Rosidin Bima and Answered by Fabian It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?