最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Add custom field to page settings in Django CMS - Stack Overflow

programmeradmin0浏览0评论

I have a PageExtension with a custom field in my Django CMS app.

How do I make this custom field editable in the Page's Settings or Advanced Settings?

I followed the tutorial on docs.django-cms but nothing appears in my admin interface.

I have a PageExtension with a custom field in my Django CMS app.

How do I make this custom field editable in the Page's Settings or Advanced Settings?

I followed the tutorial on docs.django-cms. but nothing appears in my admin interface.

Share Improve this question edited Mar 3 at 3:27 Stefan asked Mar 2 at 8:46 StefanStefan 233 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Open the admin.py file in your app folder and add the following lines.

from django.contrib import admin
from .models import MyModelName

class MyModelNameAdmin(admin.ModelAdmin):
    list_display = ('field1', 'field2' )


admin.site.register(MyModelName, MyModelNameAdmin)

You can look up more about modeladmin in the django docs

发布评论

评论列表(0)

  1. 暂无评论