I'm still relatively new to Django and have just started poking around at Django-CMS, however, I can't get past the basic introduction from the official docs.
My problem may be related to sekizai, but it feels like it's a basic url issue in urls.py.
Basically, I have followed the tutorial almost exactly. The only difference is that I have my cms app under blog/, full path ~/workspace/djangocms/blog/. I have set the STATIC_URL
and STATIC_ROOT
properly under settings.py and the same goes with my MEDIA_URL
and MEDIA_ROOT
.
I bring up the media path and directory because if I set my base template to link to css at {{ MEDIA_URL }}css/somecss.min.css
it works fine. However, doing the same with STATIC_URL: {{ STATIC_URL }}css/somecss.min.css
doesn't work and produces 404s.
Also, from what I can tell, the default /static/ routes seem to work fine for other directories. The code produced by {% cms_toolbar %}
generates fine and css from places like /static/cms/css/plugins/cms.toolbar.css are being served properly.
Contents of urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'blog.views.home', name='home'),
# url(r'^blog/', include('blog.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
(r'^admin/', include(admin.site.urls)),
url(r'^', include('cms.urls')),
)
if settings.DEBUG:
urlpatterns = patterns('',
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT,
'show_indexes': True}),
url(r'',
include('django.contrib.staticfiles.urls')),
) + urlpatterns