netcop-ai/users/admin.py
thecyberlearn 060c3a9c78 Initial commit: Django web app with user auth, Stripe payments, and n8n workflow integration
Features:
- Email-based user authentication with token auth
- Stripe Checkout integration for wallet top-ups
- n8n workflow triggering with automatic fee deduction ($0.10)
- Comprehensive transaction and usage logging
- Django Admin interface for monitoring
- Rate limiting and security middleware
- Production-ready deployment configuration
- Modular settings (dev/prod environments)
- UUID primary keys for enhanced security
- Comprehensive test coverage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 13:34:19 +05:30

29 lines
996 B
Python

from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from .models import User
@admin.register(User)
class UserAdmin(BaseUserAdmin):
list_display = ('email', 'wallet_balance', 'is_active', 'created_at')
list_filter = ('is_active', 'is_staff', 'created_at')
search_fields = ('email',)
ordering = ('-created_at',)
fieldsets = (
(None, {'fields': ('email', 'password')}),
('Personal info', {'fields': ('first_name', 'last_name')}),
('Wallet', {'fields': ('wallet_balance',)}),
('Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions')}),
('Important dates', {'fields': ('last_login', 'date_joined', 'created_at', 'updated_at')}),
)
add_fieldsets = (
(None, {
'classes': ('wide',),
'fields': ('email', 'password1', 'password2'),
}),
)
readonly_fields = ('created_at', 'updated_at')