Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7847981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:03:33+00:00 2026-06-02T18:03:33+00:00

I would like to add some extra fields to pages in django-cms (in django

  • 0

I would like to add some extra fields to pages in django-cms (in django admin panel). How do this in the simplest way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:03:34+00:00Added an answer on June 2, 2026 at 6:03 pm

    Create a new app (called extended_cms or something) and in models.py create the following:

    from django.db import models
    from django.utils.translation import ugettext_lazy as _
    from cms.models.pagemodel import Page
    
    class ExtendedPage(models.Model):   
        page = models.ForeignKey(Page, unique=True, verbose_name=_("Page"), editable=False, related_name='extended_fields')
        my_extra_field = models.CharField(...)
    

    then create an admin.py:

    from models import ExtendedPage
    from cms.admin.pageadmin import PageAdmin
    from cms.models.pagemodel import Page
    from django.contrib import admin
    
    class ExtendedPageAdmin(admin.StackedInline):
        model = ExtendedPage
        can_delete = False
    
    PageAdmin.inlines.append(ExtendedPageAdmin)
    try:
        admin.site.unregister(Page)
    except:
        pass
    admin.site.register(Page, PageAdmin)
    

    which will add your extended model to as an inline to any page you create. The easiest way to access the extended model setttings, is to create a context processor:

    from django.core.cache import cache
    from django.contrib.sites.models import Site
    
    from models import ExtendedPage
    
    def extended_page_options(request):
        cls = ExtendedPage
        extended_page_options = None    
        try:
            extended_page_options = request.current_page.extended_fields.all()[0]
        except:
            pass
        return {
            'extended_page_options' : extended_page_options,
        }
    

    and now you have access to your extra options for the current page using {{ extended_page_options.my_extra_field }} in your templates

    Essentially what you are doing is creating a separate model with extra settings that is used as an inline for every CMS Page. I got this from a blog post previously so if I can find that I’ll post it.

    EDIT

    Here is the blog post: http://ilian.i-n-i.org/extending-django-cms-page-model/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to add custom (non-project) files to generate some extra pages with
I want to add extra infos for some fields of a django form, and
I would like to add some paragraphs or new lines or words dynamically but
I would like to add some custom data to an image the user generates
I would like to add some data to the body of a http request
I would like to add some interactive capability to a python CLI application I've
I would like to add some debugs for my simple ruby functions and I
I would like to add some external .dll libraries e.g. glut32.dll (but it's only
I have two doubts: 1. I would like to add some client side support
I would like to add a Javascript at the end of some ajax content,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.