how to insert value in admin panel in django

Step 1: Define the Model In your Django app, define the model for which you want to insert values in the admin panel. This can be done in the "models.py" file. For example:

from django.db import models

class YourModelName(models.Model):
    field1 = models.CharField(max_length=100)
    field2 = models.IntegerField()
    # define other fields as per your requirement

Step 2: Register the Model with the Admin In the "admin.py" file of your app, register the model by importing it and registering it with the admin site. For example:

from django.contrib import admin
from .models import YourModelName

admin.site.register(YourModelName)

Step 3: Run Migrations After defining the model and registering it with the admin, run the following commands to apply the changes to your database:

python manage.py makemigrations
python manage.py migrate

Step 4: Accessing the Admin Panel Run your Django development server and go to the admin panel URL (usually http://127.0.0.1:8000/admin/). Log in with your admin credentials.

Step 5: Insert Values Once logged in, you can navigate to the model you registered and insert values using the provided interface.