It is simply upgraded to Django 1.4 and has serious problems with the new "improved" service of static and multimedia files on the development server. I love Django, but why they made these files doubly complicated with STATIC_URL, STATIC_ROOT, STATICFILES_DIR now completely outside of me.
I'm just trying to serve all files, static and uploaded, on a development server. I have STATIC_URL files working after many experiments, but I just can't get the MEDIA_URL files to be served as well.
Settings:
DIRNAME = os.path.dirname(__file__) MEDIA_ROOT = os.path.join(DIRNAME, 'media/') MEDIA_URL = '/media/' STATIC_ROOT = '' STATIC_URL = '/static/' STATICFILES_DIRS = ()
I have added media and static context processors:
TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.auth.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", 'django.core.context_processors.media', 'django.core.context_processors.static', "django.core.context_processors.request", 'satchmo_store.shop.context_processors.settings', 'django.contrib.messages.context_processors.messages',
)
and I added in url confs:
# serve static and uploaded files in DEV urlpatterns += staticfiles_urlpatterns() urlpatterns + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
with two conf settings added in the documents, first for static, and second for media.
my structure, the site being the application and the static dir hosted inside it, as pointed out by djangoproject:
<myproject> --media --settings --templates --website |->static
In templates, I can serve static content without problems with
{{STATIC_URL}}css/style.css
But any uploaded image used by the photologist is not served, but the URLs are correct:
/media/photologue/photos/cache/spawning-2_admin_thumbnail.jpg
This directory structure exits from /
Super, super confused. Now everything seems so ridiculously complicated, while I never had any problems.