M. Gar
M. Gar

Reputation: 885

Error 5 Access denied on IIS (python.exe)

I have a project in Python 2.7.10/Django 1.8.5 this portal use a function that create a directory and store images and video in this directory I use this portal with IIS 7.5 but when this function is used gives me this error:

WindowsError at /somedir/0001/
[Error 5] Acceso denegado: u'D:\\directory\\data\\something\\01'
Request Method: POST
Request URL:    http://localhost:8001/somedir/0001/
Django Version: 1.8.5
Exception Type: WindowsError
Exception Value:    
[Error 5] Acceso denegado: u'D:\\directory\\data\\something\\01'
Exception Location: C:\Python27\lib\os.py in makedirs, line 157
Python Executable:  C:\Python27\python.exe
Python Version: 2.7.10
Python Path:    
['.',
 'C:\\inetpub\\wwwroot\\miproyect',
 'C:\\Windows\\system32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Python27\\lib\\site-packages']

I tried give all the permissions to the users/groups IUSR/IIS_IUSR on the directory and the python.exe but gives the same error.

Thanks in advance for any help.

Upvotes: 1

Views: 1590

Answers (1)

Brando Zhang
Brando Zhang

Reputation: 27997

According to your description, I suggest you could try to set the enough permission for your IIS application pool identity.

More details, you could refer to below steps:

1.Open IIS management console

2.Find your python application application pool. Remember the application pool name.

enter image description here

3.Right click the folder which you hosted the application and select property.

4.Select the Security tab

5.Click the Edit button and then Add button

6.Click the Locations button and make sure that you select your computer.

7.Enter IIS AppPool\ (eg: IIS AppPool\smartcrypt) in the Enter the object names to select: text box.

8.Click the Check Names button and click OK.

9.Check Modify under the Allow column, and click OK, and OK.

Upvotes: 2

Related Questions