Skip to content

Instantly share code, notes, and snippets.

View devmahmud's full-sized avatar
🏠
Working From Home

Mahmudul Alam devmahmud

🏠
Working From Home
View GitHub Profile
@devmahmud
devmahmud / adding-to-user-admin-form.py
Created August 6, 2021 15:23 — forked from riklomas/adding-to-user-admin-form.py
How to add a field to the Django Admin Add User form using UserCreationForm. Add this to a admin.py and alter to whatever fields you'd like
# How to add a field to the Django Admin Add User form
# using UserCreationForm. Add this to a admin.py and alter
# to whatever fields you'd like
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib import admin