🚀 Django Auto Admin Demo
This demo showcases the django-admin-magic package, which automatically registers your Django models with the admin site.
{% if has_superuser %}
✅ Superuser account exists. You can log in to the admin interface.
{% else %}
⚠️ No superuser account found. Run python manage.py createsuperuser
to create one.
{% endif %}
🔧 Go to Django Admin
📊 Automatically Registered Models
The following models have been automatically registered with the Django admin site:
{% for model in models %}
{{ model.name }}
{{ model.doc|truncatewords:20 }}
Fields:
{% for field in model.fields %}
• {{ field.name }} ({{ field.type }})
{% endfor %}
{% endfor %}
🎯 Features Demonstrated
- Automatic Registration: All models are automatically registered with the admin site
- Field Detection: Different field types are properly handled
- Relationships: Foreign keys, many-to-many, and one-to-one relationships
- Polymorphic Models: Support for django-polymorphic models
- Properties: Model properties are detected and can be used in admin
- Custom Managers: Models with custom managers are supported
🔧 How to Use
- Install django-admin-magic:
pip install django-admin-magic
- Add to INSTALLED_APPS:
'django_admin_magic'
- Configure the app label:
AUTO_ADMIN_APP_LABEL = 'your_app'
- That's it! Your models are automatically registered.