我有一个非常简单的幻灯塔网站,但我难以看到我在行政小组上传来的图像。
www.un.org/Depts/DGACM/index_french.htm
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = /home/jeroen/programming/python/django/sitename/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 = http://127.0.0.1:8000/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/
页: 1 looks:
from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns( ,
# Example:
# (r ^sitename/ , include( sitename.foo.urls )),
# Uncomment the admin/doc line below and add django.contrib.admindocs
# to INSTALLED_APPS to enable admin documentation:
(r ^admin/doc/ , include( django.contrib.admindocs.urls )),
# Uncomment the next line to enable the admin:
(r ^admin/ , include(admin.site.urls)),
# http://docs.djangoproject.com/en/dev/howto/static-files/
# This method is inefficient and insecure.
# Do not use this in a production setting.
# Use this only for development.
(r ^media/(?P<path>.*)$ , django.views.static.serve ,
{ document_root : settings.MEDIA_ROOT}),
)
页: 1 looks:
from django.db import models
class Truitje(models.Model):
titel = models.CharField(max_length=50)
beschrijving = models.TextField(max_length=500)
foto = models.ImageField(upload_to= truitjes )
def __unicode__(self):
return self.titel
我能够成功地上载行政接口的照片,并储存在<条码>上。 但是,如果我去做,例如http://127.0.0.1:8000/media/truitjes/DSC00068.J
Page未发现: /media/truitjes/DSC00068.JPG
。 Same for http://127.0.0.1:8000/media/truitjes
and `“ http://127.0.0.1:8000/media/gives
驳回申请: