Django admin page not work properly and show weird look - django

Today I have updated Django to the latest version.
But for some reason when the logged in to the admin page, all I cans see is a weird-looking admin page.
enter image description here
how to solve this problem?

Related

Opencart Login Without Any User Info

I'm having a serious problem with admin panel. In the admin login page, even if i don't enter username or password I can login to admin panel. I have a website that is using opencart 3.0.3.2. I'm using Journal theme and it's version is 3.0.46.
Any suggestions?
Update:
I followed this: https://blog.sucuri.net/2016/12/unrestricted-backend-login.html and problem is gone.

Django admin not loading

I have a problem with Django admin. I can login and so on but I have way to create company profiles to Django and display them on website.
When I want to edit some profile in the admin page from my browser, it shows:
net::ERR_INCOMPLETE_CHUNKED_ENCODING.
Only browser that opens the page is Microsoft Edge.
I am not a developer, so I will try my best to make it as clear as possible.

Django / Mezzanine: Staff users can't log in to admin

Using Django 1.8 and Mezzanine 4.0 and Python 3, if I assign a user as staff, I find they don't have permission to log into the admin pages of my site. They can if I assign them as superuser (which I don't want to do). My ALLOWED_HOSTS is set up properly and the same domain appears in the "Site permissions" list for the users.
I've searched online for others who have experienced this but the only thread I found was someone who found that the problem mysteriously resolved itself when they reinstalled their entire stack (which I don't want to do either!)
Can anyone shed any light?
If you open up the settings for the user you can select the site that you want it to have access to. Check out this for further information: How to set the permissions for admins of Django/Mezzanine sites

How to access admin page - website like button

I am in the process of adding Like buttons to all of the product pages on a website. I am using all of the proper open graph tags and an app_id and everything seems to be working fine. I will be using a version of the button that does not give you the Admin or Insights links to choose from. I am wondering if there is an easy way to access those pages without the links?
Even though I am listed as an admin of the App, I am not automatically listed as an admin of each of the product pages as they are created. The only way I have been able to do it is to:
Add the default Like button code to another area of the page.
Click on the admin link then add myself as a page admin.
Delete the extra button on the page.
Access the admin area by going to facebook/pages.
This will be a pain as I add in hundreds of products! Any advice would be appreciated.
I'm facing the same issue. Sadly your way of being admin of a page via an extra button didn't work for me.
I've found this related bug in facebook developers website : http://developers.facebook.com/bugs/160664854023586?browse=search_4e946433c82379f78564182

Using the django admin's site authentication in a non-admin view

I am writing a simple django app to manage pages on a website.
The pages are created through the admin site and can be previewed using the 'view on site' function.
Each page has a 'published' boolean that determines whether the view that displays pages should show it on site.
Of course, once I change the view to respect 'published' the admin page's 'view on site' link will not show the page either.
But I want to be able to preview unpublished pages during the editing process.
So I decided to change the view to check whether there is an authenticated user associated with the request.
For example:
if request.user.is_authenticated() and request.user.is_staff:
manager=Pages.objects #returns all pages
else:
manager=Pages.live #only returns published pages
Then the appropriate manager is passed to get_object_or_404 along with the page_id captured from the URL
However, in the view, user is always Anonymous even when a user who is authenticated with the admin site clicks the 'view on site' link.
So the 'live' manager always gets used and I have the same result as before: 404 when unpublished pages are accessed from the admin site.
Is this the way its supposed to behave?
I really thought the session information would be inherited from the admin site's session.
I would appreciate any direction here because I may not be too clear on how this should work.
I don't need a login mechanism for the site so I was hoping to piggyback off the admin's login to get the ability to view unpublished pages in the admin.
Thanks
The problem is gone.
Now, if I am logged into admin I can view unpublished pages otherwise I get a 404 error.
Unfortunately, I'm not sure why it started working.
I ran some package updates (neither django nor Firefox was among them) and had to restart my (archlinux) machine.
When I restarted the django develpment server and tested the function again, all was well.
I suspect Firefox was the culprit but that's only a guess.
Anyway, thanks to anyone who gave the issue some thought.
I can stop pulling my hair out now.