Inline preview in the admin list view
Python JavaScript HTML CSS
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
adminpreview
examples/myapp/templates/preview
.gitignore
README.md
distribute_setup.py
requirements.txt
setup.py

README.md

To get inline Admin Previews in the list view

  1. Add adminpreview to your INSTALLED_APPS
  2. Inherit from PreviewAdmin in your ModelAdmin
  3. In your model's template directory, create a folder called preview, and create a template for that model's preview

Example for model Article

class ArticleAdmin(PreviewAdmin, other admin.ModelAdmin,,,_):
	list_display = (..,.., 'admin_slide_preview')
	...
	...

then edit app_that_has_ArticleModel/templates/preview/article.html

Whatever is in article.html will be shown inline Access your Article object through {{ object }} in the template