The document discusses the Django admin interface and alternatives. It describes when to use the Django admin, such as for initial data entry but not public end users. It also discusses customizing the admin display and functions. Finally, it reviews some alternative admin apps for Django like django-xadmin and django-grappelli as well as admin plugins for other frameworks like Flask.
2. WHO AND WHEN TO USE THE DJANGO ADMIN
When people ask, “What are the benefits of Django over other web frameworks?”
the admin is what usually comes to mind.
Who
• It's Not for End Users
When
• It’s usually not worth it to heavily customize the Django admin.
3. VIEWING STRING REPRESENTATIONS OF
OBJECTS
• Implement the __unicode__ ()
#EXAMPLE 15.1
from django.db import models
class IceCreamBar(models.Model):
name = models.CharField(max_length=100)
shell = models.CharField(max_length=100)
filling = models.CharField(max_length=100)
has_stick = models.BooleanField(default=True)
def __unicode__(self):
return self.name
4. VIEWING STRING REPRESENTATIONS OF
OBJECTS
• Implement the __unicode__ ()
>>> IceCreamBar.objects.all()
[<IceCreamBar: Vanilla Crisp>, <IceCreamBar: Mint Cookie Crunch>,
<IceCreamBar: Strawberry Pie>]
5. VIEWING STRING REPRESENTATIONS OF
OBJECTS
• Use list_display
#EXAMPLE 15.3
from django.contrib import admin
from .models import IceCreamBar
class IceCreamBarAdmin(admin.ModelAdmin):
list_display = ("name", "shell", "filling”,)
admin.site.register(IceCreamBar, IceCreamBarAdmin)
10. OTHER FRAMEWORKS
Flask-admin
plays nicely with various ORM's, including SQLAlchemy, MongoEngine,
pymongo and Peewee.
file management interface
redis client console
11. OTHER FRAMEWORKS
Web2py
Web-Based IDE: Create, modify, deploy and manage application from
anywhere using your browser. One web2py instance can run multiple web sites
using different databases.
12. DJANGO ADMIN PLUGIN
django-xadmin(by sshwsfc)
• Drop-in replacement of Django admin
• Twitter Bootstrap based UI with theme support
• Extensible with plugin support
• Better filter, date range, number range, etc.
• Built-in data export with xls, csv, xml and json format
• Dashboard page with widget support
• In-site bookmarking
• Full CRUD methods
• Documentation: Chinese
http://demo.xadmin.io
13. DJANGO ADMIN PLUGIN
django-grappelli (by sehmaschine)
• Clean and consistent look & feel
• Related lookups with Autocompletes
• Inline sortables with Drag & Drop
• Compass-based CSS
• Integrated TinyMCE theme
• Customizable dashboard
• Improved collapsibles
• Unified jQuery-Plugins
• Compatible with django—filebrowser
14. DJANGO ADMIN PLUGIN
django-admin2 (by pydanny)
• Rewrite of the Django Admin backend
• Drop-in themes
• Built-in RESTful API
• (django-rest-framework)
django-admin-bootstrapped
• Bootstrap theme