Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while setting a django project on IIS

I was following these steps for setting up django on IIS8. I got till the end of the documentation but when i ran the localhost on port 8003, i was getting the following error:

Error occurred while reading WSGI handler:

Traceback (most recent call last):
  File "C:\inetpub\wwwroot\Django\[myprojname]\wfastcgi.py", line 710, in main
    env, handler = read_wsgi_handler(response.physical_path)
  File "C:\inetpub\wwwroot\Django\[myprojname]\wfastcgi.py", line 567, in read_wsgi_handler
    return env, get_wsgi_handler(handler_name)
  File "C:\inetpub\wwwroot\Django\[myprojname]\wfastcgi.py", line 538, in get_wsgi_handler
    handler = getattr(handler, name)
AttributeError: 'module' object has no attribute 'wsgi'


StdOut: 

StdErr: 

Can anyone let me know why it wouldn't give me the same output as shown in the tutorial?

like image 823
Abhishek Avatar asked Dec 15 '25 13:12

Abhishek


1 Answers

Apparently pip install django does not set the proper permissions for IIS to use the libraries it downloaded.

You need to find your Python folder (C:\python27 by default) and forcibly reset the permissions, i.e. Replace all child object permissions with inheritable permissions from this object as shown here: https://serverfault.com/questions/475612/replace-permission-entries-on-all-child-objects-using-icacls

like image 187
user3774995 Avatar answered Dec 17 '25 20:12

user3774995



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!