Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#10054 closed (invalid)

Naming issue with static files in standard urlpattern

Reported by: thomas.m.magee@… Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I am using Django 1.0.2.

The Django book suggests that django users put the following in their urlconf to support static files:

(r'site_media/(?P<path>.*)$', 'django.views.static.serve',

{'document_root': '/path/to/media'}),

In the development server this makes static resources accessible at

And this works well. However, if you change "site_media" to "media" as follows:

(r'media/(?P<path>.*)$', 'django.views.static.serve',

{'document_root': '/path/to/media'}),

The django development server responds with a 404 error for all requests to

Change History (2)

comment:1 Changed 9 years ago by Karen Tracey

Resolution: invalid
Status: newclosed

"media" is the default used by ADMIN_MEDIA_PREFIX:

So if you want to use "media" for your site media, you need to also change ADMIN_MEDIA_PREFIX to something else -- you can't use the same prefix for both admin media and your own static files.

comment:2 Changed 9 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

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