Django admin pages makes my models invisible

For some reason, my / admin page made models that I defined not editable. This is on my deployed server using apache and postgres. I registered as superuser and it shows links as follows:

whhyyyy

If I look at the same code locally on the development server associated with postgres, it looks like this:

enter image description here

Any idea what could be causing this?

** Update **

Therefore, it is not always blocked. I signed up today and I had access to several actions (I cleared some false email requests from my DB), but then, having deleted some lines, it returned to read-only state.

I still don’t know what causes it.

home.models.py:

from django.db import models from django import forms from django.utils import timezone class EmailRequest(models.Model): email = models.EmailField() created_date = models.DateTimeField(default=timezone.now()) class EmailRequestForm(forms.Form): email = forms.EmailField() 

home.admin.py:

 from django.contrib import admin from home.models import EmailRequest class EmailRequestAdmin(admin.ModelAdmin): list_display = ('email', 'created_date') admin.site.register(EmailRequest, EmailRequestAdmin) 
+6
source share
2 answers

I do not have a direct answer to your problem, but I have a few personal considerations. First of all, using the Bitnami Django stack is probably a problem. I used it a couple of times and I will never again. The setup is certainly NOT perfect, and there is too little documentation available to make your life easier (wait, isn't it all about using the Bitnami stack?).

I would start looking at your logs (apache error logs and postgres error logs), I'm sure there is something there that will point you in the right direction.

I am sure that you are running the development server from your local machine, which is completely different from the Bitnami stack. The best solution would be to install everything yourself on a Ubuntu barebone server. Then you will have much more knowledge about the installation.

The best you can do is learn how to use Vagrant . This will help you maintain an instance of the local virtual machine that is identical to your EC2 mailbox. You will log in using ssh, just like EC2, and you will use it externally, just like an EC2 box. The closer you can get your development environment in your production environment, the easier the debugging problems will be.

Hope this didn't make your life more difficult (seriously, if you earn a vagabond, your life will become much easier)

0
source

See the following solution: No access to models in admin panel with DEBUG = False

quote:

Well, I found the cause of my problems. This was caused by registering my model in the admin panel from model definition files. When I moved all my registrations to one external admin.py file, then everything worked correctly.

0
source

All Articles