• Register
0 votes

Problem :

I am trying to deploy my Python Flask application in my Azure web app. I had created web app(Flask) and published the code. After publishing it, I am facing below error from the site.

The page cannot be displayed because an internal server error has occurred.

When I checked the Log, I could see the above error.

But this was the case only in my subscription(my free subscription with MSDN). But it was working fine in the Organisation subscription.

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have gone through your question and I understood it.

I had faced the similar issue in the past and so know the solution on it.

The <fastCGI> settings must be done in your applicationHost.config file (in your system.webServer section) of IIS. Just putting it into your web.config does not work (I can confirm it by testing it on a local IIS). An example of the configuration may look like as below :

      <environmentVariable name="PYTHONHOME" value="C:\home\Python27" />

You must adjust your configuration according to above configuration.

This should help you in solving it for a local IIS where you can edit the applicationHost.config.

Further Readings :

You can find more hints below: 


9 7 4
38,600 points

Related questions

0 votes
1 answer 1.5K views
Problem : I am trying to convert my working Python 2.7 code into Python 3 code but I am facing following error post data should be bytes, an iterable of bytes, or a file object. it cannot be of type str.
asked Nov 16, 2019 peterlaw 6.9k points
0 votes
1 answer 17 views
Problem: typeerror: '_io.textiowrapper' object is not subscriptable.
asked Feb 19 Dan phillip 2.4k points
1 vote
2 answers 4.4K views
Problem : Getting bellow python and django error 'virtualenv' is not recognized as an internal or external command, operable program or batch file.
asked Nov 8, 2019 peterlaw 6.9k points
0 votes
1 answer 24 views
Problem: error: (-215:assertion failed) !empty() in function 'cv::cascadeclassifier::detectmultiscale'
asked Feb 19 Lucky Guy 1.4k points
0 votes
1 answer 114 views
Problem : I am unable to understand what am I missing here: Sort my_short_names in reverse alphabetic order. The sample output from the given program as below : ['Tody', 'Samy', 'Joey', 'Jany', 'Anny'] Below is my code for your reference : my_short_names = ['Jany', 'Samy', 'Anny', 'Joey', 'Tody'] my_short_names.sort() print(my_short_names)
asked Jan 8, 2020 alecxe 7.5k points
1 vote
1 answer 282 views
Problem : I am getting bellow flask app error error: could not locate flask application. you did not provide the flask_app environment variable.
asked Nov 8, 2019 peterlaw 6.9k points
0 votes
1 answer 9 views
Problem input contains nan, infinity or a value too large for dtype('float64').
asked Feb 11 charles mathews 3.9k points
0 votes
1 answer 785 views
Problem: I have recently started learning Python so I have only fundamental knowledge in Python. Please find below my Transaction class for your reference: class Transaction(object):     def __init__(self, company, num, price, date, is_buy):         self.company = company         ... Python and because of lockdown I am unable to find any help to fix this issue. So I am posting my question here.
asked Aug 10, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 25 views
Problem : Recently I have started learning Homebrew. Now if I try to run Homebrews brew doctor command on my Mac OS X 10.9.2 I have started receiving the below listed warning message: Warning: Python is installed at /Library/Frameworks/Python.framework Homebrew only ... /usr/local/bin/python. But still if I rerun the brew doctor command I am still facing the same warning message listed above.
asked Apr 4, 2020 morrisBson 3.2k points
1 vote
1 answer 189 views
Problem: I am getting an interesting error: valueerror: mixing iteration and read methods would lose data while I&rsquo;m trying to run my script on python. I have no idea about this problem. I am trying to open a text file in my program and read it. Please ... test_file I think I am doing something wrong with using the readline() function. I am looking forward to having a solution. Thanks, guys.
asked Mar 29, 2020 Gavin 15.3k points