Search code examples
pythondjangofastcgiwindows-server-2012

Django Windows IIS Fastcgi Deploy problem (wfastcgi TypeError: 'module' object is not callable)


Traceback (most recent call last):
 File "C:\...", linse 847, in main
   result = handler(record.params, response.start)
TypeError: 'module' object is not callable

why am i getting this error ? when use runserver everything is fine but with fastcgi not work :/

OS: Windows Server 2012
Django Version: 2.22

Environment Variables FastCGI Application Settings;

DJANGO_SETTINGS_MODULE: website.settings
PYTHONPATH: ||PROJECT_ROOT_PATH||
WSGI_HANDLER: website.wsgi


Solution

  • I believe you are missing parentheses at the end of the WSIG_HANDLER environment variable.

    WSGI_HANDLER: website.wsgi()
    

    If you were to use the default wsgi_handler from django, you would have .get_wsgi_application() at the end:

    WSGI_HANDLER: django.core.wsgi.get_wsgi_application()
    

    You can check more information on this at the wfastcgi PyPi page