Deploying Django + xlwings library
I'm trying to deploy a Django app which uses the xlwings dependency (windows only) on a server. Tried on Linux, but it does not support xlwings. So, now looking out for an easy way to set up the Deployment with Windows instead.
Until now, I've really only been using PaaS offerings for deployment which did the work for me. Would appreciate it if somebody could describe the general approach (preferably on Azure) for making such a deployment as easy as possible.
I've tried looking around various threads and google, but I fear this is not a common requirement.
Thank you!
I had the same issue trying to deploy a Django app that uses xlwings
. Since it needs Excel and only works on Windows, Linux won’t work directly. (You could install a Windows VM on Linux and bridge it, but that’s more complex.)
What worked for me was setting up a Windows Server VM on Azure (Windows Server 2022 VM)
Installed Python, Excel (Office 365), and my project which was in django then i Ran the app using waitress:
pip install waitress
waitress-serve --port=8000 myproject.wsgi:application
I also used NSSM to run the server as a Windows service, so it starts automatically when the VM boots.
NB: Excel isn’t thread-safe, so you may need to queue or limit requests if you’re using it in production to avoid crashing