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

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.

Related

Django web site URLS gets "?next=" randomly after deployed to heroku

After deploying django app on heroku the url after every form submission or link in site been press resulting with "?next=" inserts into the URL address, I don't understand from where it comes and why heroku keep inserting them in a random way, running the application locally just working perfectly.
I've deleted the application from heroku and upload it again, the fault persists.
There's no http errors what so ever. If I keep submitting the form eventually will works.
For example: pressing the log button in the django admin console results with this URL: https://appname.herokuapp.com/admin/login/?next=/admin/login/admin/, hitting it quite a bit will finally make it work with the correct url display: https://mishnayot.herokuapp.com/admin/.
Switching from heroku postgres to AWS RDS postgres didn't help.
Help will be very appreciated.
When a user hits a page requiring authentication, they get redirected to the login URL with a ?next= indicating the page they were trying to access. This way, after they've logged in, they'll get the page they intended to access.
In your case, it seems like /admin/login/admin/ requires a login and the login is actually at /admin/login/. I'm guessing you have a bad link to /admin/login/admin/ somewhere when you intended to just have /admin/login/?
Well, struggling for days just to understand it's heroku backend issue and there's not enough information that could help me solving it (i did try to contact heroku support directly but I'm on a free account).
Finally I decided to deploy it using elastic beanstalk. The implementation took some time with long learning curve but now my site works and works great!
Thanks for trying to help Tim.
Cheers!

404 error on Flask (cPanel). 3 refreshes needed

I'm setting up a new flask web app hosted on a python app on cPanel, everything working but each time I send a command or i refresh the page or a new function runs the 404 error appears. If i refresh the page 3 times starts working again.
I tried to change the settings of Flask, but nothing is working.
something on your script of sessions is missing. You can either redeploy and see if it is solved. Or check the log file if the system is giving any warning or errors. In case you are not sure how to check log file then follow the steps in this tutorial.
tutorial

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.