Quick Start Guide¶
This guide will help you get started with Django PDF Export quickly.
Basic Setup¶
1. Install the Package¶
2. Update INSTALLED_APPS¶
Add to your Django settings:
3. Run Migrations¶
Adding Export Actions¶
1. Import Actions¶
In your admin.py
:
from django.contrib import admin
from django_pdf_actions.actions import export_to_pdf_landscape, export_to_pdf_portrait
2. Add to ModelAdmin¶
@admin.register(YourModel)
class YourModelAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'created_at') # Your fields
actions = [export_to_pdf_landscape, export_to_pdf_portrait]
Basic Usage¶
- Go to your model's list view in Django admin
- Select the records you want to export
- Choose either:
- "Export to PDF (Portrait)"
- "Export to PDF (Landscape)"
- Click "Go"
- Your PDF will download automatically
Example Configuration¶
1. Create Export Settings¶
- Go to Admin > Django PDF > Export PDF Settings
- Click "Add Export PDF Settings"
- Configure basic settings:
- Mark as active
- Save
2. Test the Export¶
- Go to your model's admin list view
- Select a few records
- Try both portrait and landscape exports
Next Steps¶
- Configure Custom Settings