External Exam Download Resources Web Applications Games Recycle Bin

setup


windows server & iis using FastCGI to handle WSGI apps

assuming you are server / machine admin:

  1. download or 2012 iso
  2. install standard with , i used a bootable usb cause of the size (5GB)
  3. install and configure IIS - web (or available offline here:pdf), credit the guide to James Polera (published 9th March 2015)
  4. use windows command prompt to install flask (cd\python34\scripts, pip install flask)
  5. use windows command prompt to start python webapp (cd\python34, python c:\inetpub\wwwroot\site.py)
^^ or whatever your python app file name is called

externally visible IP
default python / flask apps run on localhost (only). to make apps accessible on your machines ip address change python / flask source code to following:
app.run(host= '0.0.0.0')
...and access via port 5000, eg: specify port if you have more than one app running:
app.run(host="0.0.0.0", port=5001)

troubleshooting
  1. turn off windows firewall and windows defender (both enabled by default and block pretty much everything)
  2. give permissions to creator owner, network service, system, pretty much everyone on the share

enable debug mode
  1. use windows command prompt, type: SET FLASK_DEBUG=1 (anywhere on C:\, before you launch your site).
  2. this saves you restarting your python server every time you make a change to your source code..
  3. make a windows batch file
    take all of the above, create a new notepad file on server desktop, go.bat and add:
    SET FLASK_DEBUG=1
    CD\PYTHON34
    PYTHON C:\inetpub\wwwroot\site.py
    pause
    last line pause gives you the 'Press any key to continue' prompt in DOS.. good for reading errors before the cmd prompt window disappears