1 2from django.conf import settings 3from django.conf.urls import include, url 4from django.contrib import admin 5from django.contrib.staticfiles.urls import staticfiles_urlpatterns 6from django.conf.urls.i18n import i18n_patterns 7from django.views.i18n import JavaScriptCatalog 8from django.views.static import serve 9 10from cms.test_utils.project.placeholderapp.views import example_view 11from cms.utils.conf import get_cms_setting 12 13admin.autodiscover() 14 15urlpatterns = [ 16 url(r'^media/(?P<path>.*)$', serve, 17 {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), 18 url(r'^media/cms/(?P<path>.*)$', serve, 19 {'document_root': get_cms_setting('MEDIA_ROOT'), 'show_indexes': True}), 20 url(r'^jsi18n/(?P<packages>\S+?)/$', JavaScriptCatalog.as_view()), 21] 22 23urlpatterns += staticfiles_urlpatterns() 24 25 26urlpatterns += i18n_patterns( 27 url(r'^admin/', admin.site.urls), 28 url(r'^example/$', example_view), 29 url(r'^', include('cms.urls')), 30) 31