Opened 19 years ago

Closed 11 years ago

Last modified 11 years ago

#1349 closed Cleanup/optimization (fixed)

MEDIA_URL and MEDIA_ROOT do not serve the files

Reported by: lzap@… 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 lzap@…, 19 years ago

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?

comment:2 by anonymous, 19 years ago

Resolution: invalid
Status: newclosed

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 anonymous, 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 anonymous, 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 anonymous, 11 years ago

Easy pickings: unset
Resolution: invalid
Status: closednew
UI/UX: unset

This *still* needs documentation fixes! No where near MEDIA_* is this mentioned!

comment:6 by Tim Graham, 11 years ago

Component: Core (Other)Documentation
Owner: changed from Adrian Holovaty to Tim Graham
Severity: majorNormal
Status: newassigned
Triage Stage: UnreviewedAccepted
Type: defectCleanup/optimization

comment:7 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In fb7c347f7bd360b567c0b30697a6a200be2d6778:

Fixed #1349 -- Clarified docs on serving files from STATIC/MEDIA_URL.

comment:8 by Tim Graham <timograham@…>, 11 years ago

In 5783088eecddd935be3c641437748040669f91c0:

[1.6.x] Fixed #1349 -- Clarified docs on serving files from STATIC/MEDIA_URL.

Backport of fb7c347f7b from master

comment:9 by Tim Graham <timograham@…>, 11 years ago

In 2a2d7db01f0032c9dbf446757c121fa2a5904a45:

[1.7.x] Fixed #1349 -- Clarified docs on serving files from STATIC/MEDIA_URL.

Backport of fb7c347f7b from master

Note: See TracTickets for help on using tickets.
Back to Top