0

Dear StackOverflow community, your help would be greatly appreciated.

I have zero experience with IIS. Unfortunately, a Windows Server 2012 with IIS 8.5 is all I can get for the current project. I followed this post by Matt Woodward to get my Django app running on IIS. I serve static files by means of an application that references the static folder. The app looks the way it is supposed to look and all GET requests are processed properly. However, the response to all POST requests (on localhost and remotely) is Status 500 Server Error. If I run my Django app with the runserver command, the POST requests are processed properly.

POST is NOT blocked in IIS Request Filtering -> HTTP Verbs. POST requests are sent to URLs like http:/site_title/update_plan/, not to html. The StackOverflow posts found here and here were not helpful.

I suspect the problem is in the IIS settings, but maybe some special Django settings are required and I am missing it. Any ideas on what can be done to fix the problem would be of great help. Thanks!

evnica
  • 300
  • 3
  • 11
  • What does your `ALLOWED_HOSTS` setting look like? Does the error occurr when you run the application in debug mode too? – Johan Oct 02 '18 at 08:11
  • `ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'xxx.xxx.xxx.xx', 'site_title']`. I have tried it with `['*']` too, it does not make any difference. Debug settings do not change anything eather, I have tried both `True` and `False`. – evnica Oct 02 '18 at 08:20
  • 1
    What does the application log say? Is there any error/traceback in there? – Will Keeling Oct 02 '18 at 08:21
  • @Will Keeling, you are my hero! I did not have any logging in the production version. When I added logging I've got an error because of the denied writing permission. I added the corresponding permission as described here: https://stackoverflow.com/a/36597241/5110677. This solved the problem with `POST` requests too. – evnica Oct 02 '18 at 08:45

0 Answers0