I have recently deployed my web app utilizing the hosting service pythonanywhere.com. My website seems to do just fine when being opened on Microsoft Edge. However, when I open the site on chrome it is does not load the majority of images/animations/text. In addition, my website works well when running on my computer on chrome (not local host just a regular link). It is running using Flask (python) and html/CSS/JavaScript. I do not know where to start looking in terms of trouble shooting this problem. Does anyone have any advice?
I tried to change the html files for each page as they are saved as Microsoft Edge html files to chrome files. Have yet to fully pursue that potential solution, as I am using git to transfer the files to pythonanywhere so I think i need to change the files in git and not just my computer.
Related
I've developed an ASP.NET website on IIS (virtual Windows Server using Amazon Lightsail) which works as expected for the most part. But one issue with it is with running specialized Python scripts.
In my website, there is a feature where a user (of a certain account level) can upload an image, which is then passed through Python (through Process.Start). After Python does its thing, it sends text output back to the webpage. This works perfectly under the context of IIS Express in my local computer, but on the server, it seems to not run Python at all.
It is noted that I did not receive any warnings or errors. Seems to entirely skip the Process.Start segment.
I suspect that it is due to either of these:
Security access
The application pool
The Process.Start function
Things I tried:
Changing the security settings of the folder with the Python app and the scripts, as well as the Python executable
Changing the application pool of the website to LocalSystem
Disabled dynamic compression
Added a script map for the Python app
Reinstalled Python from Users/Administrator/Local/Appdata... to C:/Python (also changed the required paths in the website code behind) I also made sure that I installed the right Python libraries for the code to work.
Apart from the file paths in the code behind, nothing is changed in the actual ASP.NET website and DLL. Ideally I should not need to change anything else with regards to the website.
The website still does not call Python. I've been scratching my head for the past two days on this single issue.
Also, the folder where the Python scripts and related files are located are within wwwroot.
Any suggestions are much appreciated.
TL;DR: ASP.NET website that calls Python to run an already-coded script as part of its function works great under IIS Express. Python does not run when called under IIS Server.
I'm trying to write a python executable that runs in the background and records the amount of time I spend on facebook. This is one of my first projects in software development. The problem is, I haven't found a way to access the chrome browser and look at what URL's are open.
I've used selenium webdriver, but it seems to only be able to open up new tabs.
I've found some kind of google extension called google tabs api, but i'm not entirely sure if it even is a library I can import into python or if it's even meant for python.
I developed a python web app in flask and I'm trying to deploy it correctly on IIS.
Before i launch the app to production server I'm testing it on a VM.
All the steps i did:
Install IIS with CGI
With IIS installed, I download the web platform installer
I installed the WFastCGI for Python 3 (my version)
I configured the Handler Mappings and the CGI Settings to deploy my app, and is all fine.
The Website is all working, except one part. One of the functions of the website require execute a webdriver, in this case PhantomJS, with selenium python module.
The PhantomJS executable is on the root folder of the website:
PhantomJSPath = 'phantomjs/bin/phantomjs.exe'
But when i try to use declare the variable to select the webdriver his just don't run on IIS (when i open that specific page of that function it gives me a 500 ERROR, all the other pages work perfectly). The stupid thing is, when i execute by Flask development mode on port 5000 it just works perfectly.
browser = webdriver.PhantomJS(PhantomJSPath)
I tried a lot of stuff already like give all permissions to everyone on the web app folder and stuff like that. I think the problem is with IIS configuration or security settings.
I hope you can help me and all of the other people with the same issue ;) TY
Ok, i solved it. just configured the Website settings on IIS and Application pool to the specific path of the website, give all the permissions to the IIS user (IIS_USRS) and it works. Ty anyway!.
If you know any other ways to fix this issue just post. I Will mark if it works too.
I use the google cloud endpoints configuration as
https://cloud.google.com/appengine/docs/python/endpoints/test_deploy
exactly, I run google chrome with flag
--user-data-dir=temp --unsafely-treat-insecure-origin-as-secure=http://localhost:8080
as
https://developers.google.com/explorer-help/#hitting_local_api
then, Google Chrome say me
You are using an unsupported command-line
(--unsafely-treat-insecure-origin-as-secure) flag. Stability and
security will suffer
If I visit
_http://localhost:8080/_ah/api/explorer
then I get the error:
The API you are exploring is hosted over HTTP, which can cause
problems. Learn how to use Explorer with a local HTTP API .
I try to add --test-type flag as
_http://stackoverflow.com/questions/32042187/chrome-error-you-are-using-an-unsupported-command-line-flag-ignore-certifcat
then google chrome dont say anything, but when I visit
_http://localhost:8080/_ah/api/explorer
I get the same error.
my app works fine in localhost except the endpoints part, and all works fine in appspot.com (endpoints too)
I use the last version of:
Python 2.7.11
App Engine SDK 1.9.35
Google Chrome 49.0.2623.110
thank you and sorry for my english
Click the shield button in Chrome's url bar.
Click "Load unsafe scripts".
Click services (on the left bar) to reload the page.
I tried troubleshooting this issue when it first started happening for me. I quickly gave up and decided to just use another browser for the API explorer on localhost. IE 11 works for me. This isn't a great answer, but if you have other browsers installed, give them a try.
While Alex has the best answer, I'd just like to point out that this is only a problem with the API Explorer (which can definitely be handy).
But it doesn't affect direct calls to the API itself. So the URL below works fine without having to open a special sandbox chrome app or changing the script settings
localhost:8080/_ah/api/greeting/v1/greetings/1
I built a web site with python and django which is deployed with apache 2.2.
Recently I made a huge change to the website. I just replaced the all the programs and templates and static files with the new version and restarted apache.
However, from my browser I still saw the old webpage. I then refreshed the page several times before the new page showed up. Worse, one of my colleagues still cannot access my new webpage after clearing his browser data and restarted computer. With developer tools, I found his browser got the right source html but somehow failed to show the right webpage.
I have the following questions:
Is this problem browser related or server related?
How can I ensure every browser display the right webpage?