Django-Jazzmin behaving differently for local and production

I have a project where i am displaying models using django-jazzmin. I also have set the same db and same db user for both the environments. The problem is that I cannot see anything in production. Also in the network tab I can see the page but it is not being rendered I am not sure. I will be attaching the screenshot for the same also.I want to know how can I debug this and what can be the cause for this behaviour. I have just made changes to the models file and when i applied the migrations then it started happening for production and for local it is working completely fine.As i can share just one screenshot I am sharing the screenshot for production where I can see the page in the network tab response but nothing is there in the top and also there is no request which is failing in the network tab

What versions of Python and Django are you using in development and production?

python version is 3.9
django version is 4.0.3
django-jazzmine version is 2.5.0
They are same for both environments

The last release of django-jazzmin was Nov 2022, for Django 3.2.16 (django-jazzmin 2.6). To work with Django 4 (or newer) you may need to use an “unreleased” or unpackaged version.

I suggest you check the issues in the repo to see if there are any identified problems with it and Django 4.

Otherwise, I’d consider this to not be “suitable for use” with a current Django installation - unless you’re interested in ensuring it’s brought up-to-date for your environment.

But the thing is it is working as expected in local as well Staging. Why only it is not working in production. I have double checked the requirements file in all the environments. I have checked the db connections as well. I am attaching a screenshot for the same page in local environments. Also a thing to note is that this is happening for only two models one is the HomePage and another is AboutUs. Rest all the pages are working fine.

Have you run migrate on your production database for those model changes to be applied?

using the commands manage.py makemigrations and migrate. I have checked the db and the changes are visible there.

Next step then would be to verify that the versions of all the python libraries are the same between the two environments.

Yes I have double checked. Everything is the same and I have installed them from the same requirements.txt file.

Also a key thing to note is that I am only facing the problems for 2 models. Every other model is working fine.
Here is one of the admin.py files
class HomePageCMSAdmin(admin.ModelAdmin):

   fieldsets = (
    ('Section 1 - Main', {
        'classes': ('collapse',),
        'fields': ('section_1_image','section_1_video',)
    }),
    ('Section 2 - About Eddi', {
        'classes': ('collapse',),
        'fields': ('section_2_heading','section_2_description','section_2_left_button_text','section_2_left_button_link','section_2_right_button_text','section_2_right_button_link'),
    }),
     ('Section 3 - Courses Eddi Offers', {
        'classes': ('collapse',),
        'fields': ('section_3_heading','section_3_button_text','section_3_button_link',),
    }),
    ('Section 4 - Eddi Partners', {
        'classes': ('collapse',),
        'fields': ('section_4_heading','section_4_logo',),
    }),
    ('Section 5 - News and Articles', {
        'classes': ('collapse',),
        'fields': ('section_5_heading','section_5_blog',),
    }),
    ('Section 6 - Testinomials', {
        'classes': ('collapse',),
        'fields': ('section_6_heading','section_6_description','section_6_testinomials',),
    }),
    ('Section 8 - Become Supplier', {
        'classes': ('collapse',),
        'fields': ('section_8_heading','section_8_image','section_8_description','section_8_button_text','section_8_button_link'),
    }),
)

admin.site.register(HomePageCMS, HomePageCMSAdmin)

This is the one with issues.

I understand that it’s only affecting two models.

This means one of two things - either something is environmentally different between the two or some important data is different between the two.

If you’re not seeing any error messages / tracebacks in the production server logs associated with this, then it’s up to you to identify what’s different between the two environments.

Another option would be to copy your data from production to a development environment to see if you can recreate the problem locally - in which case this would be an indication that you’ve got some bad / unexpected data in the model.

Which files can be the cause of the issue? I have checked all the major files such as admin.py, models.py and settings.py. They all are the same. I am also using the same .env for local as well as production but still I am not sure what is wrong

Other than saying “any of them”, we’d have no way of knowing that. And without having complete access to both environments, we’re not in a position to help you with this either - this is something you’re going to need to track down.

I think your best next step is to try to recreate the production problem in your development environment.

Another debugging step would be to run this in an environment without Jazzmin to see if you encounter this issue using the native admin tools. (If that’s the case, then at least you have a direction to continue your investigation.)

Can you guide me from where I need to start tracking the issue?

I have already provided you with that information in my previous responses.

Sorry for that. But I tried removing the models.
class HomePageCMSAdmin(admin.ModelAdmin):

   fieldsets = (
    ('Section 1 - Main', {
        'classes': ('collapse',),
        'fields': ('section_1_image','section_1_video',)
    }),
    ('Section 2 - About Eddi', {
        'classes': ('collapse',),
        'fields': ('section_2_heading','section_2_description','section_2_left_button_text','section_2_left_button_link','section_2_right_button_text','section_2_right_button_link'),
    }),
     ('Section 3 - Courses Eddi Offers', {
        'classes': ('collapse',),
        'fields': ('section_3_heading','section_3_button_text','section_3_button_link',),
    }),
    ('Section 4 - Eddi Partners', {
        'classes': ('collapse',),
        'fields': ('section_4_heading','section_4_logo',),
    }),
    ('Section 5 - News and Articles', {
        'classes': ('collapse',),
        'fields': ('section_5_heading','section_5_blog',),
    }),
    ('Section 6 - Testinomials', {
        'classes': ('collapse',),
        'fields': ('section_6_heading','section_6_description','section_6_testinomials',),
    }),
    ('Section 8 - Become Supplier', {
        'classes': ('collapse',),
        'fields': ('section_8_heading','section_8_image','section_8_description','section_8_button_text','section_8_button_link'),
    }),
)

admin.site.register(HomePageCMS, HomePageCMSAdmin)
If i remove the CMSAdmin it is working as expected. So the issue is with the class HomePageCMSAdmin

I have removed jazzmin by commenting it out from the installed apps Now it is working for both of the environments

Locally i was able to create the same scenario when I changed the version of jazzmine from 2.5.0 to 2.6.0.
But in the dev environment the version is 2.5.0 i tried reinstalling the different versions but still nothing helps

I have resolved the issue it was with the virtual environment defaulting to 3.10 and my project needed 3.9. Thanks and sorry for the inconvenience.