How to Create an admin user

twitter logo github logo ・1 min read

First, create Model

class Contact(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField(max_length=100)
subject = models.CharField(max_length=100)
message = models.TextField()
mobile = models.IntegerField()
created_date = models.DateField(auto_now_add=True)
Import model within the admin

from django.contrib import admin
from .models import Contact

Register your models here.

admin.site.register(Contact)

Read more: https://realprogrammer.in/how-to-create-an-admin-user/

twitter logo DISCUSS
Classic DEV Post from Jun 6

What programming best practice do you disagree with?

Discussion about an unusual interview question

siddharth shukla profile image
I train professional software engineers that companies love to hire. I cover a wide range of subjects like programming, what's latest in tech, new frameworks, open-source products etc.

👋 Hey dev.to reader.

Do you prefer sans serif over serif?

You can change your font preferences in the "misc" section of your settings. ❤️