Project

General

Profile

Bug #874

Static content reports "File not found" when not running from document root.

Added by Rudi Daemen about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Rudi Daemen
Category:
Core
Target version:
-
Start date:
2012-06-15
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

The uweb page resides in the path /uweb/ and the static content resides in /uweb/static/. In router.py, this is configured as static path:

ROUTES = (('/uweb/', 'Index'),
('/uweb/static/(.*)', 'Static'),
('/uweb/(.*)', 'FourOhFour'))

If I open the static file /uweb/static/index.html uweb reports "This is not the path you're looking for. No such file u'/uweb/static/index.html'":
http://fludizz.kratjebierhosting.nl/uweb/static/index.html

History

#1 Updated by Elmer de Looff about 7 years ago

  • Status changed from New to Feedback
  • Assignee set to Rudi Daemen
  • Priority changed from Low to Normal

Rudi,

Where does this file reside on your disk, relative to the pagemaker that fulfills your requests? The default directory from which requests are fulfilled is the 'static' directory that is in the same directory as the PageMaker is in. That is, if you your pagemaker is in '/path/to/pagemaker/pages.py', then static files will start resolving in '/path/to/pagemaker/static/'.

If you have a request for http://fludizz.kratjebierhosting.nl/uweb/static/index.html, the file tried to access would be '/path/to/pagemaker/static/index.html', with your provided route.

Does this function for you or not?

#2 Updated by Rudi Daemen about 7 years ago

If I move the static content to the (/static/) to the folder where the pagemaker resides, it indeed functions.
I was under the impression it requested the path relative to the webdir instead of relative to the location of the pagemaker.

#3 Updated by Elmer de Looff about 7 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

By default it requests from the 'static' relative directory. See also the documentation for serving static content.

I'm going to close this bug as it's not an actual bug. Should the documentation be lacking, unclear, or other suggestions / bugs be found, please open a new issue.

Also available in: Atom PDF