Open beruic opened 6 years ago
Thanks for that! I wasn't aware of wfastcgi (thanks, Microsoft!), this is a good pointer for people having problems with this package. I may put a note into the README later. This project is not really maintained anymore. Also, the Celery part does not work anymore, as Celery is no more supported under Windows. I personally still use the fastcgi part at work for a client, as it it's quite convenient, and from time to time someone else still seems to use it, but the traffic is generally quite low. I did some minor fixes occassionally, and I may continue to do so, but I don't have a server system available for testing either. Also, I see that even under Windows, django is nowadays often run in a container (e.g. in the Windows docker client), so I don't see much future demand for this package.
Well, my reason for looking into this package, is that you cannot run a Linux container on Windows without virtualization. So when your the host machine provided to you is a virtual Windows server, you have no choice. I guess this will hold true until the Windows Subsystem for Linux is more widely available (because the Windows server versions you generally get is newer), and mature (so it can run services upon boot).
I am sorry to say that I have not been able to use
django-windows-tools
for deploying. I have however found a simple way of deploying in IIS with wfastcgi and will share my experiences in the hope that it may improve this project.Basically I added a FastCGI application from my virtual environment with full path being
[venv_root]\Scripts\python.exe
and arguments being[venv_root]\Lib\site-packages\wfastcgi.py
. This is automated by wfastcgi by the installed commandwfastcgi-enable
(there is also awfastcgi-disable
for removing it again).Then I add my site root as a new site using the following template to create the
web.config
(Note that[site_root]
,[venv_root]
and[project_module]
must be replaced):This setup requires that
STATIC_URL = '/static/'
andSTATIC_ROOT = os.path.join(BASE_DIR, 'static')
to avoid creating a virtual directory in IIS, but I guess that can be automated.You may also want to give full access to the site root to the app pool user.
Other than that, my only caveat is that I don't use MEDIA in my project, but I guess that is just a matter of repeating the procedure for static.