Python Flask application host in IIS with fast cgi process - python-2.7

Please guide me how python2.7 Flask framework application host in IIS with fast CGI process. I searched so many ideas on the internet but it doesn't help me till now. Anyone can give me simple process to do it and if you have video tutorial then please share the link of it. Some trial I want to specify,
Install IIS feature 'on' like CGI
Create Virtual Environment and link to physical project folder
Convert to Application
select application --> Click on Handler Mapping--> Add Script Map and input required data like *.py, python27.exe %s %s --> ok
Placed all .py file in 'cgi-bin' folder
convert into application
Edit in 'C:\Windows\System32\inetsrv\config\applicationHost.config'
Open application in browser with sample py application like print 'Hello'. Getting output as I mentioned in sanp.
*** First I tried with simple application then I want to host Flask Framework.

Related

Opening browser in server from hosted Flask application in IIS not working

I am working on a flask application which needs to open a browser inside server and do some operations based on the user input. My application is working in visual studio and spyder. But when hosted it is not opening browser.
I tried:
webbrowser : Work in local but hosted code is not working
pyppeteer : Work in local but hosted code is not working
subprocess : Work in local but hosted code is not working
I tried running a batch file from the hosted code to write into a file, this is working in local but the hosted code is not even running the subprocess.
Can someone help on this?
Thanks in advance!

Using Django web application to be submitted as a project

I have my main project created in Django as a web application, I have completed my coding. So now that I have to submit the project and have to present it. Is there any way I can render it as an application so that my tutor could just click on an icon or link and just directly open the application instead of starting a server and multiple other things before using the app. Any advice that would help the application to dodge this complicated process would be much appreciated.
I even tried looking up information on this but couldn't find anything ueful.
There are websites that provide free web hosting, you could upload your code there and upload the database and once you have that set up just get the url link to it and give it to the person you want.
I remember using https://www.awardspace.com/ for my school web projects. it could help you.
Theres is no way I know of that you could just render and get an .exe file to just click and install and run.

Sublime Text auto touch and upload file

I'm using Sublime text with the FTPSync plugin to develop a Flask web application deployed by Phusion Passenger.
Due to the way my web application is cached on the remote server, whenever I make a change to my actual web application I also need to change the last modified date on a file in Flask's '/tmp' folder on the web server in order for changes to my other web application's files to take effect (this based on advice from How do I clear the cache of Ruby Phusion Passenger in Ubuntu?).
Currently I have a 'restart.txt' in my web application's '/tmp' directory which I 'touch' (add a char/remove a char, then save) and then upload using FTPSync which causes the other changes I've FTP'd to the server to take effect.
I'm looking for a way to automatically touch that 'restart.txt' file and upload it whenever a file in my web app project is uploaded (currently anytime I 'save' a file).
Is there any way in Sublime Text 2 to script an action to automatically touch + upload a file and have that script run whenever a file is being uploaded?

Web Service application in Delphi 2007

created and deployed a Web service application in a virtual directory using IIS 6.1. The client application works fine on the same machine. But it is not working in another machine where the client application is copied manually. Can any one help what went wrong?
In Internet explorer, The XML file is displayed in the same machine. But from other machine, 'Un able to open the page' error occurs.
Suggestions please...
Regards,
Baskaran A.
Did you check your firewall settings? Can you open other pages that are served by the same IIS webserver?
My first 2 guesses would be:
1) Firewall settings, as previously mentioned.
2) The client app has a hard coded path in it somewhere that ought to be a relative path or, perhaps a URL. Something along the lines of 127.0.0.1 or localhost or C:\... within the app or in its configuration file(s).

Is there a way to bind my flex builder to my django application

I am trying to create simple flex application, which uses django as a back-end part. Have a question:
Usually when I run my application Flex Builder creates a file in a directory on my local PC and then opens a browser and points to it. Everything was fine, but when I decided to link django server to flex applications via xml data providers I started to get security errors. (Related to absence of crossdomain.xml). When I created the file and put it on the server:
<?xml version="1.0"?>
<!-- http://www.foo.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="http://127.0.0.1:8000"/>
<allow-access-from domain="127.0.0.1"/>
</cross-domain-policy>
Then tried the application again, I got error in console of my FB Error: Request for resource at http://127.0.0.1:8000/go/active/ by requestor from file:///Users/oleg/Documents/FB3/usersList/bin-debug/usersList.swf is denied due to lack of policy file permissions.
I don't know how to fix the error. But also the question is there a way to configure FB3 to put my swf files to the server directly, so I will not need any crossdomain?
Thanks
Oleg
We struggled with this a lot. The Flex security stuff didn't strike me as well built, but perhaps we just had different approaches in mind than Adobe's developers. The solution that worked for us was to serve both the SWF and the dynamic data from the same host and port.
On our development boxes, we tell Apache to serve the SWF from a directory in the workspace, and the dynamic data from a local copy of the app. When we push to production, SWF and app get pushed simultaneously to the same virtual host.
If that's inconvenient for you, the Apache ProxyPass directive can be used to make Apache front for other servers. I've not used that in production, but it's been very handy for developer setups.
I don't know a way to get FlexBuilder to automatically deploy your changed SWF; you could certainly look into an automation approach (like Maven and Flex-Mojos) to make that happen.
That said, getting rid of that error is usually just a matter of adding a policy file to the server.
The second error is caused because you're trying to fetch http resources from a "file" location. My recommendation is that you change your Flex Builder project so it outputs to a location within the Django web site, rather than to the flex-bin directory. This setting can be changed in the properties dialog of the project. Then, you should be able to have your front-end and back-end share the same protocol and domain.