# Django-Jazzmin behaving differently for local and production

**URL:** <https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144>\
**Category:** The Admin\
**Created:** [March 16, 2024, 10:30am UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144 "2024-03-16T10:30:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 10:30am UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/1 "2024-03-16T10:30:18Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/a/c/ac9d36cc22cba4df04a75909f67dc46071c24c8e.png)

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2024, 11:37am UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/2 "2024-03-16T11:37:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 11:40am UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/3 "2024-03-16T11:40:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2024, 11:58am UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/4 "2024-03-16T11:58:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 1:48pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/5 "2024-03-16T13:48:02Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/6/6/66d7e07d3e13b2e785d204043749ac41cb4ce152.png)

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2024, 2:22pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/6 "2024-03-16T14:22:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 2:23pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/7 "2024-03-16T14:23:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2024, 2:24pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/8 "2024-03-16T14:24:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 2:26pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/9 "2024-03-16T14:26:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 2:29pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/10 "2024-03-16T14:29:47Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 2:31pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/11 "2024-03-16T14:31:07Z")

</div>

This is the one with issues.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2024, 2:57pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/12 "2024-03-16T14:57:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 3:02pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/13 "2024-03-16T15:02:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2024, 3:05pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/14 "2024-03-16T15:05:00Z")

</div>

> [@Gautam0205](#):
>
> Which files can be the cause of the issue?

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.)

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 3:06pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/15 "2024-03-16T15:06:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 16, 2024, 3:07pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/16 "2024-03-16T15:07:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 3:08pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/17 "2024-03-16T15:08:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 3:19pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/18 "2024-03-16T15:19:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 16, 2024, 7:48pm UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/19 "2024-03-16T19:48:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gautam0205](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gautam0205/32/16399_2.png) [@Gautam0205](https://forum.djangoproject.com/u/Gautam0205)\
**Post date:** [March 18, 2024, 4:02am UTC](https://forum.djangoproject.com/t/django-jazzmin-behaving-differently-for-local-and-production/29144/20 "2024-03-18T04:02:41Z")

</div>

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.
