from django.contrib import admin from django import forms from pages.models import Page from django.conf import settings from django.forms import TextInput, Textarea from django.db import models class PageAdmin(admin.ModelAdmin): formfield_overrides = { models.TextField: {'widget': Textarea(attrs={'rows':25, 'cols':40})}, } list_display = ('title', 'slug',) search_fields = ['title', 'body_markdown'] prepopulated_fields = {"slug" : ('title',)} fieldsets = ( ('Page', { 'fields': ('title','body_markdown', 'slug'), 'classes': ('show','extrapretty','wide') }), ('Metadata', { 'classes': ('collapse closed',), 'fields': ('meta_description',), }) ) admin.site.register(Page, PageAdmin)