#1349 closed Cleanup/optimization (fixed)
MEDIA_URL and MEDIA_ROOT do not serve the files
Reported by: | Owned by: | Tim Graham | |
---|---|---|---|
Component: | Documentation | Version: | |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I use latest stable:
# Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = '/home/lzap/public_html/nc/media/', # URL that handles the media served from MEDIA_ROOT. # Example: "http://media.lawrence.com" MEDIA_URL = '/media/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media_admin/'
I start the devel server on port 8080 and try to access some files from the media directory. I always get 404. I tried to set the MEDIA_URL either to '/media' or to 'http://localhost:8080/media' but with no luck. Strace commands shows the Python is not trying to access a disc - it simply do not recognize the URL.
I know I should a web server for this, but I do not want to run an Apache for developing. The documentation is brief about this settings. I think this is a bug or something.
Change History (9)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Check out http://www.djangoproject.com/documentation/static_files/
Please don't use bug tracker for support q - django-users mailing list is the place.
comment:3 by , 19 years ago
You should wrote in the documentation near the MEDIA_URL (or in the tutorial) that man needs to use django.views.static.serve for this...
comment:4 by , 19 years ago
And please note this is very unclear. I thought this was a bug... The documentation do not shows what is MEDIA_* for...
comment:5 by , 11 years ago
Easy pickings: | unset |
---|---|
Resolution: | invalid |
Status: | closed → new |
UI/UX: | unset |
This *still* needs documentation fixes! No where near MEDIA_* is this mentioned!
comment:6 by , 11 years ago
Component: | Core (Other) → Documentation |
---|---|
Owner: | changed from | to
Severity: | major → Normal |
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
Type: | defect → Cleanup/optimization |
comment:7 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I was told to use 'flatfiles' but this seems to be "pages in a database".
How to setup the devel server to serve static files? Are these MEDIA_* settings the right place? If so why this doesnt work?