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