Data Service Admin Interface
The Django Admin interface provides a powerful GUI for managing Apps, DataSources, and DataTables. This guide covers all administrative features.
Accessing the Admin
URL
https://your-domain.com/admin/
Login
Use your superuser or staff account credentials.
App Administration
App List View
Location: Admin → App → Apps
Features:
- List Display: Name, slug, datasource count, active status, creation date, creator
- Filters: Active status, creation date
- Search: Name, slug, description
- Actions: Bulk operations on selected apps
Columns:
- Name: App name
- Slug: URL-safe identifier (auto-generated)
- Datasources: Clickable link showing count
- Is Active: Active/inactive status
- Created At: Timestamp
- Created By: User who created the app
Creating an App
-
Click "Add App" button
-
Fill in the form:
- Name (required): Application name
- Slug (auto-filled): URL-safe identifier
- Description (optional): Documentation
- Is Active: Checkbox (default: checked)
-
Click "Save" to create
Notes:
- Slug is auto-generated from name using slugify
- User tracking (created_by, modified_by) is automatic
Editing an App
- Click on app name in list
- Modify fields
- Click "Save" or "Save and continue editing"
Field Sections:
Basic Information
- Name
- Slug (read-only after creation)
- Description
Status
- Is Active
Statistics (collapsed by default)
- Datasource Count: Link to datasources
- Table Count: Total across all datasources
Metadata (collapsed by default)
- Created At (read-only)
- Updated At (read-only)
- Created By (read-only)
- Modified By (read-only)
Deleting an App
Soft Delete:
- Use the admin to mark
is_active = False - Also marks all datasources and datatables as inactive
Hard Delete:
- Use the "Delete" button
- Cascades to all datasources and datatables
- Warning: This is permanent!
DataSource Administration
DataSource List View
Location: Admin → Data → Data sources
Features:
- List Display: Name, slug, app link, provider type, table count, active status, creation date
- Filters: Provider type, active status, creation date, app
- Search: Name, slug, description, app name
- Actions: Bulk operations
Columns:
- Name: DataSource name
- Slug: URL identifier
- App: Clickable link to parent app
- Provider Type: flat_table, jsonb, or mongodb
- Tables: Clickable count linking to tables
- Is Active: Status indicator
- Created At: Timestamp
Creating a DataSource
-
Click "Add Data source" button
-
Fill in the form:
- App (required): Select parent app
- Name (required): DataSource name
- Slug (auto-filled): URL-safe identifier
- Description (optional): Documentation
- Provider Type (required): Choose from dropdown
- Provider Config (optional): JSON configuration
- Is Active: Checkbox
-
Click "Save" to create
Provider Types:
- Flat PostgreSQL Tables: Traditional SQL tables
- PostgreSQL JSONB: JSON document storage
- MongoDB Collections: MongoDB integration
Provider Config Example:
{
"compression": "lz4",
"indexing": "gin",
"custom_options": {
"buffer_size": 8192
}
}
Viewing Provider Config
The admin shows two versions of provider_config:
- Editable JSON: Raw JSON input
- Formatted Display: Pretty-printed, read-only view
DataSource Details
Field Sections:
Basic Information
- App (dropdown)
- Name
- Slug (prepopulated from name)
- Description
Provider Configuration
- Provider Type (dropdown)
- Provider Config (JSON editor)
- Provider Config Display (formatted, read-only)
Status
- Is Active
Statistics (collapsed)
- Table Count: Link to tables
- Materialized: Shows "X / Y" format
Metadata (collapsed)
- Timestamps and user tracking
DataTable Administration
DataTable List View
Location: Admin → Data → Data tables
Features:
- List Display: Name, datasource, app, field count, materialization status, active status, creation date
- Filters: Materialization status, active status, creation date, app, datasource
- Search: Name, description, physical table name, datasource name, app name
- Actions: Bulk operations
Columns:
- Name: Table name (used in API URLs)
- DataSource: Link to parent datasource
- App: Link to app
- Fields: Count of fields in schema
- Is Materialized: Whether physical table exists
- Is Active: Status indicator
- Created At: Timestamp
Creating a DataTable
-
Click "Add Data table" button
-
Fill in the form:
- DataSource (required): Select parent datasource
- Name (required): Table name
- Description (optional): Documentation
- JSON Schema (required): Frictionless Table Schema
- Is Materialized: Checkbox
- Is Active: Checkbox
-
Click "Save" to create
JSON Schema Input:
Use the JSON editor to define your Frictionless Table Schema:
{
"fields": [
{
"name": "id",
"type": "integer",
"constraints": {
"required": true,
"unique": true
}
},
{
"name": "email",
"type": "string",
"format": "email",
"constraints": {
"required": true
}
}
],
"primaryKey": ["id"]
}
Validation:
- Schema is validated on save
- Invalid schemas show error messages
- Field types and constraints are checked
DataTable Details
Field Sections:
Basic Information
- DataSource (dropdown)
- Name
- Description
Frictionless Table Schema
- JSON Schema: Editable JSON field
- JSON Schema Display: Formatted, read-only view with syntax highlighting
- Help text: "Define table structure using Frictionless Table Schema format"
Physical Storage (collapsed)
- Physical Table Name (auto-generated, read-only)
- Is Materialized (checkbox)
Schema Metadata (collapsed)
- Schema Hash (SHA256, read-only)
- Field Count (calculated, read-only)
- Field Names (comma-separated list, read-only)
Status
- Is Active
Metadata (collapsed)
- Timestamps and user tracking
Schema Display Features
The admin provides multiple views of the schema:
- Editable JSON: For creating/updating
- Formatted Display: Pretty-printed with scrolling
- Field Analysis: Extracted field names and count
- Hash Tracking: For cache invalidation
Physical Table Name
Auto-generated format: {app_name}_{table_name}
Example:
- App: "My Application"
- Table: "users"
- Physical: "my_application_users"
The name is sanitized (spaces → underscores, lowercase).
Schema Operation Administration
SchemaOperation List View
Location: Admin → Data → Schema operations
Features:
- List Display: Operation type, status, datasource, table, timestamps
- Filters: Operation type, status, datasource, creation date
- Search: Datasource name, table name, error message
- Read-Only: Operations are created by the system
Columns:
- Operation Type: CREATE_TABLE, ALTER_TABLE, DROP_TABLE
- Status: PENDING, IN_PROGRESS, SUCCESS, FAILED, ROLLED_BACK
- DataSource: Link to datasource
- Table: Link to table (if applicable)
- Started At: When operation began
- Completed At: When operation finished
- Created At: When operation was logged
Viewing Operation Details
Field Sections:
Operation Info
- DataSource (link)
- Table (link)
- Operation Type
- Status
Operation Details (collapsed)
- Raw JSON: Operation parameters
- Formatted Display: Pretty-printed view
SQL Commands (collapsed)
- Executed SQL: The SQL that was run
- Executed SQL Display: Formatted with syntax highlighting
- Rollback SQL: SQL to undo the operation
- Rollback SQL Display: Formatted view
Execution Tracking (collapsed)
- Started At
- Completed At
- Error Message (if failed)
Metadata (collapsed)
- Creation timestamp and user
Operation Status Flow
PENDING → IN_PROGRESS → SUCCESS
↓
FAILED → ROLLED_BACK (optional)
Admin Tips & Best Practices
1. Search Functionality
Quick Search:
- Apps: Search by name, slug, description
- DataSources: Search by name, slug, app name
- DataTables: Search across name, datasource, app
2. Filtering
Use filters to narrow down results:
Active apps only → Filter: Is Active = Yes
Recent datasources → Filter: Created At = Today
Materialized tables → Filter: Is Materialized = Yes
3. Bulk Operations
Select multiple items and choose an action:
- Mark as inactive (soft delete)
- Hard delete (careful!)
- Export selected
4. Navigation
Quick navigation via clickable links:
- App → DataSources → DataTables
- Datasource counts link to filtered datasource list
- Table counts link to filtered table list
5. JSON Editing
Tips for JSON Schema editing:
- Use a JSON validator before pasting
- Check the formatted display after saving
- Validation errors appear at the top of the form
- Keep a backup before major schema changes
6. Audit Trail
Every record tracks:
- Created At / Created By
- Updated At / Modified By
- Assigned To (if applicable)
Use this for compliance and debugging.
7. Schema Operations Log
Monitor the SchemaOperation model for:
- Failed operations
- Performance issues
- Rollback history
- Audit compliance
Common Admin Tasks
Task 1: Create Complete Data Structure
-
Create App
- Navigate to App admin
- Add new app with name and description
-
Create DataSource
- Go to DataSource admin
- Select the app
- Choose provider type
- Configure provider settings
-
Create DataTable
- Go to DataTable admin
- Select the datasource
- Define Frictionless schema
- Save and verify
Task 2: Update Existing Schema
- Find the DataTable in admin
- Click to edit
- Modify the
json_schemafield - Save
- Check that
schema_hashupdated - Review SchemaOperation log for changes
Task 3: Deactivate Resources
Soft Delete (Recommended):
- Edit the resource
- Uncheck "Is Active"
- Save
Benefits:
- Preserves data
- Can be restored
- Maintains referential integrity
Task 4: Find Related Resources
From App:
- Click datasource count → filtered datasource list
From DataSource:
- Click table count → filtered table list
From DataTable:
- Click datasource link → datasource details
- Click app link → app details
Task 5: Troubleshoot Schema Issues
- Check DataTable admin for validation errors
- Review SchemaOperation admin for failed operations
- Check error messages in operation details
- Verify Frictionless schema format
- Test schema in API docs before admin save
Keyboard Shortcuts
Django admin provides shortcuts:
- Ctrl+S / Cmd+S: Save
- Escape: Close popup
- Tab: Navigate fields
- Arrow Keys: Navigate dropdowns
Mobile Access
The Jazzmin theme provides responsive admin:
- Works on tablets and phones
- Touch-friendly interface
- Collapsible sidebars
- Optimized for small screens
Permissions
Required Permissions
App Management:
app.add_appapp.change_appapp.delete_appapp.view_app
DataSource Management:
data.add_datasourcedata.change_datasourcedata.delete_datasourcedata.view_datasource
DataTable Management:
data.add_datatabledata.change_datatabledata.delete_datatabledata.view_datatable
Granting Permissions
- Go to Users admin
- Select user
- In "User permissions" section:
- Search for app/data permissions
- Add to "Chosen permissions"
- Save
Or create a Group with permissions:
- Go to Groups admin
- Create group (e.g., "Data Managers")
- Add all data service permissions
- Assign users to the group
Security Considerations
- Limit Admin Access: Only grant to trusted users
- Use Groups: Manage permissions via groups
- Audit Regularly: Review SchemaOperation logs
- Backup Before Changes: Especially schema updates
- Test in Development: Validate changes before production
- Monitor User Activity: Check user tracking fields
Troubleshooting
Problem: Can't save DataTable
Solution:
- Check schema validation errors at top of form
- Verify JSON syntax is correct
- Ensure required fields are present
- Check field type names match Frictionless spec
Problem: Slug already exists
Solution:
- Each slug must be unique within its scope
- Apps: Globally unique slugs
- DataSources: Unique within app
- DataTables: Unique within datasource
- Manually specify a different slug
Problem: Schema hash not updating
Solution:
- Ensure you're actually changing the
json_schemafield - Save the form (hash updates on save)
- Check if save was successful
- Review any error messages