antoinemartin / django-windows-tools

Django application providing management commands to host Django projects in Windows environments
BSD 2-Clause "Simplified" License
51 stars 13 forks source link

After hosting a project with IIS 8 give bad request 400 #18

Open umyhacker opened 7 years ago

umyhacker commented 7 years ago

Hi Guys,

I am trying to host a django project on my windows server 2012 using your django-windows-tools. I successfully installed django-windows-tool and its dependencies. I successfully hosted my application in IIS using django-windows-tool. I am unable to access my website on my domain or localhost. IIS gives bad request 400 error. Django development server is running without any error from the same directory on localhost:8000. I checked my bindings. Bindings are correct. Because I can say that because I already hosted other webapps on the same server.

my web.config is:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <clear/>
      <add name="FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\Python36-32\python.exe|C:\inetpub\security\radrann\manage.py winfcgi --pythonpath=C:\inetpub\security\radrann" resourceType="Unspecified" requireAccess="Script" />
    </handlers>
  </system.webServer>
</configuration>

My project is hosted from : Initpub folder. I also checked for security settings.

mrbean-bremen commented 7 years ago

Hm, looks ok for me, but I haven't tested this with spaces in the python path yet. You may try to install python into another path to check if this causes the problem.

mrbean-bremen commented 7 years ago

Another possibility (in case this is the problem) would be to use the short path instead of the path with spaces, e.g. replace the path in the config with something like C:\PROGRA~2\PYTHON~1\python.exe.

mrbean-bremen commented 7 years ago

Did you get anywhere yet?

mrbean-bremen commented 6 years ago

In case this is still an issue: how did you configure ALLOWED_HOSTS? If the hostname does not match that, it also gives a 400 error (ran into this recently).

mrbean-bremen commented 6 years ago

@umyhacker - did you get anywhere here, or is this still an issue?