Source

django-stockphoto / stockphoto / admin.py

from django.contrib import admin
from models import Gallery, Photo

class GalleryAdmin(admin.ModelAdmin):
    ordering = ['date']
    prepopulated_fields = {
        'slug': ('title',),
        }
admin.site.register(Gallery, GalleryAdmin)

class PhotoAdmin(admin.ModelAdmin):
    ordering = ['date']
admin.site.register(Photo, PhotoAdmin)