任何一個可以告訴我什麼是問題找到媒體directory.In模板當我說/media/images/logo.jpg這是無法找到/ media目錄Django的設置問題
的/媒體目錄是在/ home /項目/ MyProject的 任何一個可以告訴我如何解決這個問題
我在settings.py文件的follwoing
MEDIA_ROOT = '/home/project/myproject/media/'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = ''
# 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/'
以下是myproject.wsgi文件
sys.path = ['/home/project/lib/python2.6/django/', '/home/project/lib/python2.6','/usr/local/lib/python2.6/site-packages','/home/project/myproject'] + sys.path
from django.core.handlers.wsgi import WSGIHandler
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
application = WSGIHandler()
我有chnaged MEDIA_URL ='路徑'即即/媒體我應該做什麼。在我的模板時,我說/media/js/javascriptfile.It無法找到它.. – Rajeev 2011-03-25 16:47:19