Cannot login to Django admin - django

My admin login in development stopped working suddenly. It used to be working fine for almost a year. I am able to see the login page and type the superuser credentials. When I click on the login button, nothing happens. The admin log also does not show anything. I have tried changing the port number and ran the server.
I even created a new project and new database and tried running the simple admin page, no luck. I tried running the admin for other projects in development, still nothing happens on clicking the login button.
My settings does have:
AUTHENTICATION_BACKENDS = (
('django.contrib.auth.backends.ModelBackend'),
)
Another thing that I noticed was I do not get a new row in the django_session table even after I login with the correct superuser credentials

I suggest you to clear your localhost cookies and try with another browser.
I've issues with chrome v28 that I don't have in firefox v22.
Let me know if it helps.
Regards.
-- EDIT --
Try to put this line in your settings.py. It solved for me.
SESSION_COOKIE_DOMAIN = None

Opening the application in chrome's incognito mode resolved this issue for me.

Related

Is it possible to keep Django Admin Panel accesible in production mode? (DEBUG=False)

I am developing a webpage for my college where we will show ouur investigations, to solve that i decided to use the admin panel. The problem is that when I deply in production the webage I get a 500 Bad request
I have left the deault admin path
Also changed the path for admin and still having the same issue
Try opening on a different browser like chrome etc

Django admin page login causing IIS to crash, need to restart iis everytime

My site is working fine. I can access all the pages. But when I am accessing admin page, it loads, prompts for username and password. After entering username and password when clicked login, it takes sometimes and after that I get below error:
This page isn’t working mytestapp.company.com didn’t send any data.
ERR_EMPTY_RESPONSE
After refreshing the page, I get below error:
Service Unavailable HTTP Error 503. The service is unavailable.
After this no page loads. After restarting IIS using cmd (iisreset /noforce) again when I try to refresh the homepage, I see I am logged in which means admin page logged me in but after that response did not come and it something went wrong on the server side which caused server to crash.
I am not sure how to proceed with this. Earlier my admin site use to work fine. No recent changes in code. The only change I did is I synced the DB from another DB which has more data.
I am using virtual env which has
python version is 2.7.3, Django version 1.3 in it
IIS version 7.5 on WindowsServer 2008R2 (Python IsAPIe handler)
Please help me on this. I am stuck with this issue...
Issue is resolved now. IIS service was getting stopped because of a series of error caused while rendering admin page. After checking windows event log and understanding error code, got to know that the Python-Runtime.dll which admin page was referring was having some issue. I replaced the dll with the previous working version and then everything started working fine.

django oscar paypal redirect

I am using Django Oscar Paypal for payment. I am having an issue with redirecting back to my website on the production mode.
I have successfully set up in the development mode and I have tried two different IP address for runserver : 127.0.0.1:8000 and 192.168.1.102:8000 -> both worked corrected and redirected to whatever server I was running.
I turned off Sandbox mode and I have a website that has https:// working correctly. I try to make a payment on mywebsite.com/ but it redirects to https://192.168.1.102:8000/checkout/paypal/preview/13/?token=******* when I am redirected to paypal website for payment and click on Continue. (This happens for cancelling as well).
I have checked the views in the paypal app and it has 'reverse' code written correctly. If I paste /checkout/paypal/preview/13/?token=******* part after mywebsite.com/, it seems to be working correctly.
Is there a way to redirect back to mywebsite.com/
Many Thanks
Kyu
I just tried to switch to sandbox mode in the production but it doesn't redirect me to sandbox paypal! It keeps going to proper paypal payment site even with sandbox API... I am getting confused now.
Could this be because I haven't done python manage.py migrate and makemigrations?
Oscar uses the Django sites framework to determine the appropriate return URL.
You probably have the wrong domain (192.168.1.102) configured on your Site.
Edit the site from the admin (at example.com/admin/sites/site/) to set the domain that you use in production. Once you change this the redirect from Paypal should work.

Django authentication works on Chrome, but not on Firefox

I'm having a problem where Django's login is working okay on Chrome but not on Firefox: when trying to login to a restricted portion of the site on Firefox, it simply loops back again and again to the login page; furthermore, no error message appears on the log regarding that.
Interestingly, the error doesn't happen when the server is on the local machine.
Does someone have a general idea of what could be causing that strange behavior?
I'm using Django 1.6 on Python 2.7
this isn't much of an answer, but a linking to other similar problems. Because I don't have rep, all I can do is leave an answer.
A issue like this was encountered in 2012 but was never conclusively answered:
Django session doesn't work in Firefox
A similar question where the user could login via local server but not remote firefox was encoutered:
Unable log in to the django admin page with a valid username and password
The second was very well documented and had an accepted answer that was well liked.
Recommendations:
If you are not using https make sure you have this setting SESSION_COOKIE_SECURE = False.
If you are using a database backed, Check if the session is actually being created in the django_sessions table .
If you are using a cached backed, check that SESSION_ENGINE is django.contrib.sessions.backends.cache and that CACHE_BACKEND is properly configured.

Joomla 2.5 admin page 404

Web site functioned normally , I tried to login to admin page and suddenly when I access admin page it display:
404 - An error has occurred.
Component not found
No new extension/module/component and theme has been installed.
No changes on PHP or mysql on the server side. ( I did check with hosting providers).
It's like it works today and tomorrow when you want to login , you'll see the above mentioned error.
Renaming .htaccess did not solve the issue.
Restoring DB backup did not solve the issue.
I checked the Joomla logs ( in log folder) there isn't any related report.
Joomla version info:
$RELEASE = '2.5';
$DEV_LEVEL = '16';
Please help!
I managed to sloved this long time ago but I forgot to update!
It is solved by running repair and optimize operations on the database via phpmyadmin.