https://github.com/adiroiban/azure-web-app-klein
Example of how to run a simple Klein based server on Azure Web Services as an Web App.
https://github.com/adiroiban/azure-web-app-klein
azure azure-app-service klein twisted
Last synced: about 1 year ago
JSON representation
Example of how to run a simple Klein based server on Azure Web Services as an Web App.
- Host: GitHub
- URL: https://github.com/adiroiban/azure-web-app-klein
- Owner: adiroiban
- License: mit
- Created: 2018-03-24T00:37:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-24T00:46:46.000Z (about 8 years ago)
- Last Synced: 2025-01-23T19:51:16.123Z (over 1 year ago)
- Topics: azure, azure-app-service, klein, twisted
- Language: Batchfile
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Example Twisted Klein for Azure Web App
=======================================
Base on:
* https://prmadi.com/django-app-with-httpplatformhandler-in-azure-app-services-windows/
* https://github.com/prashanthmadi/azure-django-httphandler
Azure Configuration
-------------------
It uses the Azure App Services and runs as a Web App.
In Azure Portal, go to "Deployment Options" and configure "Local Git".
Also configure an username and password for "Deployment Credentials".
This will create a dedicated Git repo for hosting the files.
From the "Development tools -> Extensions" of the Web App,
enable Python 2.7.14 32 bit.
It used Python 2.7 as for now this is the version of Twisted for which there
is a wheel on PyPI.
Azure Deployment
----------------
Each time you push to this repo, it will run the the `deploy.cmd` on the
remote server.
It uses a custom deployment script.
It uses the IIS HTTP Handler to start the Twisted Web.
For HTTP Handler configuration see:
https://docs.microsoft.com/en-us/iis/extensions/httpplatformhandler/httpplatformhandler-configuration-reference
The HTTP Handler logs on Azure as stored in D:\home\LogFiles\python.log.
You can use the "Console" from the Azure Portal and check those logs.
Local Development
-----------------
Azure will run it on Window.
For development on Linux, you can use the requirements-linux.txt file inside
a virtual environment.
From the virtualenv use this to run on port 8080::
virtualen build
. build/bin/activate
pip install -r requirements-linux.txt
python -m twisted web -p tcp:8080 --class=twistdPlugin.resource