Hi
Im a newstarter and Im having trouble viewing the uploaded img files.
Both category and product images.
Files are uploaded but cannot be viewed - i get 404 not found
All the oscar icons is shown correctly after I configured urls.py for staticfiles (whatever that means :) and ran the command ./manage.py collectstatic
Here is my urls.py
from django.conf.urls import patterns, include, url
from
oscar.app import application
from django.contrib import admin
admin.autodiscover()
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = patterns('',
('^admin/', include(admin.site.urls)),
(r'', include(application.urls))
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
---------------------
Here is some of the img settings I made in settings.py
MEDIA_ROOT = location("public/media")
MEDIA_URL = '/media/'
STATIC_ROOT = BASE_PATH+'/static/'
STATIC_URL = '/static/'
----------------
I found a file named django.conf where this is in: (sorry I dont understand what this does, but maybe it makes the mess)
$HTTP["host"] =~ "(^|\.)myproject\.dk$" {
fastcgi.server = (
"/django.fcgi" => (
"main" => (
"socket" => env.HOME + "/myproject/myproject.sock",
"check-local" => "disable",
)
),
)
alias.url = (
"/media" => env.HOME + "/myproject/myproject/media",
"/static" => env.HOME + "/myproject/myproject/static",
)
url.rewrite-once = (
"^(/media.*)$" => "$1",
"^(/static.*)$" => "$1",
"^/favicon\.ico$" => "/media/favicon.ico",
"^(/.*)$" => "/django.fcgi$1",
)
}
---------------
example imagefile is in
/myproject/myproject/public/media/images/products/2013/08/20130827_175444.jpg
and when I click to view this img the link is pointing to
http://www.myproject.com/media/images/products/2013/08/20130827_175444.jpgThanks :o)
Michael