2015-07-18 15:33:36 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2015-09-12 22:46:05 +00:00
|
|
|
from __future__ import absolute_import, print_function, unicode_literals
|
|
|
|
|
2015-10-18 07:59:19 +00:00
|
|
|
import sys
|
|
|
|
|
2015-10-31 00:19:47 +00:00
|
|
|
from cms.sitemaps import CMSSitemap
|
2014-06-08 22:06:01 +00:00
|
|
|
from cms.utils.conf import get_cms_setting
|
|
|
|
from django.conf import settings
|
2016-06-05 21:15:21 +00:00
|
|
|
from django.conf.urls import include, url
|
2014-06-08 22:06:01 +00:00
|
|
|
from django.conf.urls.i18n import i18n_patterns
|
2015-07-18 15:33:36 +00:00
|
|
|
from django.contrib import admin
|
2016-06-05 21:15:21 +00:00
|
|
|
from django.contrib.sitemaps.views import sitemap
|
2014-06-08 22:06:01 +00:00
|
|
|
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
2016-06-05 21:15:21 +00:00
|
|
|
from django.views.i18n import javascript_catalog
|
|
|
|
from django.views.static import serve
|
2014-06-08 22:06:01 +00:00
|
|
|
|
2015-10-31 00:19:47 +00:00
|
|
|
from djangocms_blog.sitemaps import BlogSitemap
|
|
|
|
|
2014-06-08 22:06:01 +00:00
|
|
|
admin.autodiscover()
|
|
|
|
|
2016-06-05 21:15:21 +00:00
|
|
|
urlpatterns = [
|
|
|
|
url(r'^media/(?P<path>.*)$', serve,
|
2015-07-18 15:33:36 +00:00
|
|
|
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
|
2016-06-05 21:15:21 +00:00
|
|
|
url(r'^media/cms/(?P<path>.*)$', serve,
|
2015-07-18 15:33:36 +00:00
|
|
|
{'document_root': get_cms_setting('MEDIA_ROOT'), 'show_indexes': True}),
|
2016-06-05 21:15:21 +00:00
|
|
|
url(r'^jsi18n/(?P<packages>\S+?)/$', javascript_catalog),
|
2014-09-04 07:17:03 +00:00
|
|
|
url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')),
|
2016-06-05 21:15:21 +00:00
|
|
|
url(r'^sitemap\.xml$', sitemap,
|
2015-10-31 00:19:47 +00:00
|
|
|
{'sitemaps': {
|
|
|
|
'cmspages': CMSSitemap, 'blog': BlogSitemap,
|
|
|
|
}
|
2016-06-05 21:15:21 +00:00
|
|
|
}),
|
|
|
|
]
|
2014-06-08 22:06:01 +00:00
|
|
|
|
|
|
|
urlpatterns += staticfiles_urlpatterns()
|
|
|
|
|
2015-10-18 07:59:19 +00:00
|
|
|
if 'server' not in sys.argv:
|
|
|
|
urlpatterns += i18n_patterns(
|
|
|
|
url(r'^blog/', include(
|
|
|
|
'djangocms_blog.urls', namespace='djangocms_blog', app_name='djangocms_blog'
|
|
|
|
)),
|
|
|
|
)
|
2015-07-18 15:33:36 +00:00
|
|
|
urlpatterns += i18n_patterns(
|
2014-06-08 22:06:01 +00:00
|
|
|
url(r'^admin/', include(admin.site.urls)),
|
|
|
|
url(r'^', include('cms.urls')),
|
2015-07-18 15:33:36 +00:00
|
|
|
)
|