0

I have a static folder set in django to a network path

STATICFILES_DIRS = [
    "//SERVER/Shared1/FOLDER_210121/",
]

and I have 2 pages that have links to this static subfolders

link1: http://server2:8044/static/folder1/COINS_LIVE_OU164/user1310200781810167.tif link2: http://server2:8044/static/folder2/COINS_LIVE_OU164/user2310200781810167.tif

however link1 works perfectly but link 2 gives me an error as file not found

enter image description here

but the file does exist, and from IIS I have set a virtual directory aliased as "static" with the root folder that contains the subfolder from where I get the files.

I can navigate from the virtual directory to both files, the virutal directory was created with the defaultAppPool user.

is there something else I could check?

(if I run the manage.py runserver command and I use localhost I can download both files, the issue is when using it from the IIS).

if I print the value of static in a label the path is ok, so I'm guessing permission, but where can I be missing the configuration?

Thank you.

Adding a bit more info:

the issue affects a subfolder inside the "static" folder, 1 can enter without probelms, the other can't.

I'm getting crazy. I deleted all, created again, and the issue still occurs.

Baldie47
  • 1,148
  • 5
  • 16
  • 45
  • what have you set for `STATIC_ROOT`? https://docs.djangoproject.com/en/3.2/ref/settings/#static-root AND have you run collectstatic? – AMG Jun 30 '21 at 15:28
  • I haven't done "collectstatic" since it's a remote server and the size is about 500gb (it is working without it in the other directories) I don't have static root, I'll check on that now – Baldie47 Jun 30 '21 at 15:34
  • staticfiles_dirs are where collectstatic looks for files to place in static root when you run collectstatic. STATIC_ROOT should probably be pointing to your aliased static folder in iis. – AMG Jun 30 '21 at 15:40
  • However you are running Django in iis, you need to turn that off for your static folder and let iis serve them without fastcgi or whatever method you are using. – AMG Jun 30 '21 at 15:43
  • how do I turn it off? yes, I have fastcgi in IIS – Baldie47 Jun 30 '21 at 15:46
  • https://stackoverflow.com/a/37760566/4872140 (or the answer above the one linked) – AMG Jun 30 '21 at 15:48
  • uhm.. I had followed that one.. that's how I got one folder to work,. the other subfolder in my path is not working, that's super weird. shall I give permissions to the app pool user? I didn't for the fist folder – Baldie47 Jun 30 '21 at 18:31

1 Answers1

0

I was able to solve my particualr problem, it was fixed by putting the static handler module mapping alone with the Django FastCGI (custom) module in the website IIS

enter image description here

Baldie47
  • 1,148
  • 5
  • 16
  • 45