Opened 17 years ago
Closed 17 years ago
#8240 closed (invalid)
settings no longer availiable in urls.py
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Uncategorized | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
the edit of /django/core/management/init.py in [8282]
has made it so that settings are no longer available in a urls.py
settings.py
MEDIA_ROOT = '/media/'
urls.py
from django.conf.urls.defaults import *
from django.conf import settings
urlpatterns = patterns('',
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
)
this setup will always give a 404 when you try to view the static media. It is not the view but settings.MEDIA_ROOT is not accessible. any of the settings can not be accessed.
Note:
See TracTickets
for help on using tickets.
As noted on the mailing list, Karen Tracey has tried this exact example and it works. I just tried a completely unrelated project, imported settings into my url config and printed out
settings.MEDIA_ROOTand it worked (using [8309]). So this doesn't seem to be a problem. I think there's something else going on at your end here.