{{ modelxx.objectyy.url }}
Before some recent edits, that call gave a relative path and I used:
/site_media/{{ modelxx.objectyy.url }}
to get a full file path. After some site changes the .url gives a full
path and a double prefix of :
/home/trak/media/home/trak/media/dir/somefile
Pasting in a static extension of:
/site_media/dirxx/filename
Works but is obviously useless in html tag.
---- Is there a setting that forces the {{.url }} call to give a full
path
rather than relative?
ANY thoughts would be appreciated. Here are some of my settings:
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': '/home/trak/media'}),
MEDIA_ROOT = ''
MEDIA_URL = '/home/trak/media/'
###################################### Django settings
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as
not
# to load the internationalization machinery.
USE_I18N = False
# Absolute filesystem path to the directory that will hold user-
uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
# Examples: "http://media.lawrence.com/media/", "http://example.com/
media/"
MEDIA_URL = '/home/trak/media/'
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/
static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# List of callables that know how to import templates from various
sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'user_profiles.middleware.CurrentUserMiddleware',
)
ROOT_URLCONF = 'trakdrop.urls'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'registration',
'tdcreative',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
Thanks.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment