Django Admin behaves weirdly - python

I have this Django app running perfectly but sometimes Django Admin works oddly, because If I click on any model, instead of taking me to the list of registries in that model, It takes me to the same model list but with a weird css.
Here is the picture of the normal model list
Here is the picture after clicking any model
I can't add information to models or anything.

I had the same issue a few days ago. What solved the problem for me was re-collecting the statics:
(env)$python manage.py collectstatic
and then force relad (ctrl + F5) the django admin site.

Related

Django Admin ERR_QUIC_PROTOCOL_ERROR

Django Admin list view page for a single model returns a blank page. it only load some of the buttons. console shows this error Failed to load resource: net::ERR_QUIC_PROTOCOL_ERROR. Have been trying somethings but couldn't solve this one. Also it doesn't happen on local machine. I am using django jet. tried using the vanilla django admin but still the same error. Other than this model all the other model's list view page is working fine.
If anyone has faced this error in the past or know anything about it, suggest me some fixes. any help would be appreciated. Thanks

Django project is corrupted

I have a new project for a little online shop. I use the PyCharm code editor. It saves the progress whenever I switch to a new window and the server autorestarts. After a while of working on the project the server stopped doing that and now it needs to be done manually. When I got to making forms, I noticed that they don't show on the page. It's the same logic as in my previews projects. I made exactly the same forms and models from the old project in the current one and they do not work. Then I did the opposite: I added the models and the form from the current project into the old one and they do render on page.
What could be the problem and where shoul I start looking for it?

Is it possible to use Django-Admin editor/interface outside of the admin?

I have a model that I need to edit. I have it registered in Admin.py. It works fine in my admin. How do I use this particular editing interface in other parts of my project? What I mean is, I want to use the admin editor on another template to do exactly what the admin does inside of it. Is there a module or library that will let me do this in django?

Random models not registering in django admin

I have 5 models in one of my apps
Report
ReportData
Customer
..etc
For some reason, every since my last deployment, I can no longer change or create new 'Report' or 'Customer' objects, but everything else works? Any idea why this would be happening? The admin page just outputs nothing on the /add link and the /change link outputs nothing as well.
Django==1.9.1
I have tried restarting servers, running migrations, and restarting database. The development version works fine. Such a strange problem.

Using Django Admin History with a custom Login_backend and user model

I have a django application using a custom (ldap) login backend and my own extended user model that is used by other applications.
I'm using the django admin extensively but I've only just noticed that the history link leads to a yellow page. I realised that this was due to the fact that I was not using django.contrib.auth and so the auth_user table did not exist.
I uncommented that in my settings.py and the yellow screen is gone.
The history functionality is not working though and I'm guessing that's because the changes are stored against request.user but the lookup is searching for the user in auth_user.
Does anyone know how to make django admin use my user model table?
If not, does anyone have any idea how I could remove the history link from the admin object view?
Note: I'm looking for the solution with the least editing of the django source code as I will have to justify every line to my superiors.
Any help/suggestions/criticism would be very welcome
Thanks,
Hayden
You can define what is shown in the history of each model by customizing the history view, or you can simply remove the link from the admin site by overriding the admin templates.
Either of these are recommended as they are upgrade friendly and don't involve any changes to the django codebase.
To use your custom model for the built-in history feature (and other related options) see the responses to this question.

Categories