My Projects
My Projects

Reputation: 49

Django Admin Not Showing Complete Fields In a Model

I am quite new to the Django environment, Here's a problem I am facing:

First I made a model:

class ABC(Model):
     field A
     field B
     field C

then, I migrated them successfully using the following commands:

python manage.py makemigrations
python manage.py migrate

Then, I again added a new field to same model:

class ABC(Model):
     #rest fields are here
     field D

These also got migrated successfully.

But, Here's the problem now.

After migration, I am not able to see field D in the Django admin interface. (for which I want to edit the value)

AM I missing anything here?

(PS: Have tried sqlflush, dbshell every possible troubleshoot)

I also restarted NGINX & Gunicorn (since I am hosted on AWS EC2)

I am certain, that fields are getting created.

Please help.

Upvotes: 0

Views: 797

Answers (1)

Dad
Dad

Reputation: 447

First, check the admin.py file and admin.ModelAdmin class of this model.

from django.contrib import admin
from .models import ABC

@admin.register(ABC)
class ABCAdmin(admin.ModelAdmin):
    fields = ['A', 'B', 'C', 'D']

Upvotes: 2

Related Questions