# Path: basic_cms/views.py
# LANGUAGE_KEYS = [key for (key, value) in settings.PAGE_LANGUAGES]
# class Details(object):
# class PageSitemap(Sitemap):
# class PageItemProxy(object):
# class MultiLanguagePageSitemap(Sitemap):
#     def __call__(self, request, path=None, lang=None, delegation=True, **kwargs):
#     def resolve_page(self, request, context, is_staff):
#     def resolve_alias(self, request, path, lang):
#     def resolve_redirection(self, request, context):
#     def get_navigation(self, request, path, lang):
#     def choose_language(self, lang, request):
#     def get_template(self, request, context):
#     def is_user_staff(self, request):
#     def extra_context(self, request, context):
#     def delegate(self, request, context, delegation=True):
#     def items(self):
#     def lastmod(self, obj):
#     def __init__(self, page, lang):
#     def get_absolute_url(self):
#     def items(self):
#     def lastmod(self, obj):
# 
# Path: basic_cms/settings.py
# def get_setting(*args, **kwargs):
# def get_page_templates():
# TEMPLATES = get_setting('TEMPLATES', raise_error=True)
# PAGE_DEFAULT_TEMPLATE = get_setting('PAGE_DEFAULT_TEMPLATE',
#     'DEFAULT_PAGE_TEMPLATE', raise_error=True)
# PAGE_TEMPLATES = get_setting('PAGE_TEMPLATES',
#     default_value=())
# PAGE_TINYMCE = getattr(settings, 'PAGE_TINYMCE', False)
# PAGE_UNIQUE_SLUG_REQUIRED = getattr(settings, 'PAGE_UNIQUE_SLUG_REQUIRED',
#                                     True)
# PAGE_CONTENT_REVISION = getattr(settings, 'PAGE_CONTENT_REVISION', True)
# PAGE_CONTENT_REVISION_DEPTH = getattr(settings,
#     'PAGE_CONTENT_REVISION_DEPTH', 10)
# PAGE_LANGUAGES = get_setting('PAGE_LANGUAGES', raise_error=True)
# PAGE_DEFAULT_LANGUAGE = get_setting('PAGE_DEFAULT_LANGUAGE',
#     'LANGUAGE_CODE', raise_error=True)
# PAGE_EXTRA_PERMISSIONS = getattr(settings, 'PAGE_EXTRA_PERMISSIONS', extra)
# PAGE_LANGUAGE_MAPPING = getattr(settings, 'PAGE_LANGUAGE_MAPPING', lambda l: l)
# SITE_ID = getattr(settings, 'SITE_ID', 1)
# PAGE_USE_SITE_ID = getattr(settings, 'PAGE_USE_SITE_ID', False)
# PAGE_HIDE_SITES = getattr(settings, 'PAGE_HIDE_SITES', False)
# PAGE_USE_LANGUAGE_PREFIX = getattr(settings, 'PAGE_USE_LANGUAGE_PREFIX',
#                                                                         False)
# PAGE_USE_STRICT_URL = getattr(settings, 'PAGE_USE_STRICT_URL', False)
# PAGE_CONTENT_REVISION_EXCLUDE_LIST = getattr(settings,
#     'PAGE_CONTENT_REVISION_EXCLUDE_LIST', ()
# )
# PAGE_SANITIZE_USER_INPUT = getattr(settings, 'PAGE_SANITIZE_USER_INPUT', False)
# PAGES_MEDIA_URL = get_setting('PAGES_MEDIA_URL')
#     PAGES_MEDIA_URL = str(media_url) + 'pages/'
# PAGE_HIDE_ROOT_SLUG = getattr(settings, 'PAGE_HIDE_ROOT_SLUG', False)
# PAGE_SHOW_START_DATE = getattr(settings, 'PAGE_SHOW_START_DATE', False)
# PAGE_SHOW_END_DATE = getattr(settings, 'PAGE_SHOW_END_DATE', False)
# PAGE_CONNECTED_MODELS = getattr(settings, 'PAGE_CONNECTED_MODELS', False)
# PAGE_LINK_FILTER = getattr(settings, 'PAGE_LINK_FILTER', False)
# PAGE_EXTRA_CONTEXT = getattr(settings, 'PAGE_EXTRA_CONTEXT', None)
# PAGE_UPLOAD_ROOT = getattr(settings, 'PAGE_UPLOAD_ROOT', 'upload')
# PAGE_ENABLE_TESTS = getattr(settings, 'PAGE_ENABLE_TESTS', False)
# PAGE_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
# PAGE_AUTOMATIC_SLUG_RENAMING = getattr(settings, 'PAGE_AUTOMATIC_SLUG_RENAMING', False)
# INSTALLED_APPS = getattr(settings, 'INSTALLED_APPS',
#                          ())
# FILEBROWSER_DIRECTORY = False
#     FILEBROWSER_DIRECTORY = getattr(settings, 'FILEBROWSER_DIRECTORY',
#                                     getattr(filebrowser_settigns, 'DIRECTORY', False))
# PAGE_ADD_API = getattr(settings, 'PAGE_ADD_API', True)
# 
# Path: basic_cms/api.py
# class BasicCMSAPI(APIView):
#     """
#     Get basic cms page by slug in given format
# 
#     format -- json/html, html = default
#     get-children -- true/false, true by default, works only with json.
# 
#     """
# 
#     permission_classes = (AllowAny,)
# 
#     def get(self, request, slug, *args, **kwargs):
#         format = request.GET.get('format', 'html')
#         get_children = request.GET.get('get-children', True)
#         lang = get_language()
#         page = Page.objects.from_path(slug, lang)
#         if page is None:
#             raise Http404("Page does not exist")
#         if format == 'html':
#             page = render_to_string(page.template, {'current_page': page}, request=request)
#             base_url = request.build_absolute_uri('/')
#             return Response({"html": links_append_domain(page, base_url)})
#         else:
#             page = page.dump_json_data(get_children=get_children)
#             return Response(page)


from django.conf.urls import url, patterns
from basic_cms.views import details
from basic_cms import settings
from basic_cms.api import BasicCMSAPI
"""Django page CMS urls module."""



urlpatterns = patterns(
    '',
)

if settings.PAGE_ADD_API:
    urlpatterns += patterns('',
                            url(r'^basic-cms-api/(?P<slug>[-\w]+)/$', BasicCMSAPI.as_view(),
                                name='basic_cms_api'),
                            )



# Path: basic_cms/views.py
# LANGUAGE_KEYS = [key for (key, value) in settings.PAGE_LANGUAGES]
# class Details(object):
# class PageSitemap(Sitemap):
# class PageItemProxy(object):
# class MultiLanguagePageSitemap(Sitemap):
#     def __call__(self, request, path=None, lang=None, delegation=True, **kwargs):
#     def resolve_page(self, request, context, is_staff):
#     def resolve_alias(self, request, path, lang):
#     def resolve_redirection(self, request, context):
#     def get_navigation(self, request, path, lang):
#     def choose_language(self, lang, request):
#     def get_template(self, request, context):
#     def is_user_staff(self, request):
#     def extra_context(self, request, context):
#     def delegate(self, request, context, delegation=True):
#     def items(self):
#     def lastmod(self, obj):
#     def __init__(self, page, lang):
#     def get_absolute_url(self):
#     def items(self):
#     def lastmod(self, obj):
# 
# Path: basic_cms/settings.py
# def get_setting(*args, **kwargs):
# def get_page_templates():
# TEMPLATES = get_setting('TEMPLATES', raise_error=True)
# PAGE_DEFAULT_TEMPLATE = get_setting('PAGE_DEFAULT_TEMPLATE',
#     'DEFAULT_PAGE_TEMPLATE', raise_error=True)
# PAGE_TEMPLATES = get_setting('PAGE_TEMPLATES',
#     default_value=())
# PAGE_TINYMCE = getattr(settings, 'PAGE_TINYMCE', False)
# PAGE_UNIQUE_SLUG_REQUIRED = getattr(settings, 'PAGE_UNIQUE_SLUG_REQUIRED',
#                                     True)
# PAGE_CONTENT_REVISION = getattr(settings, 'PAGE_CONTENT_REVISION', True)
# PAGE_CONTENT_REVISION_DEPTH = getattr(settings,
#     'PAGE_CONTENT_REVISION_DEPTH', 10)
# PAGE_LANGUAGES = get_setting('PAGE_LANGUAGES', raise_error=True)
# PAGE_DEFAULT_LANGUAGE = get_setting('PAGE_DEFAULT_LANGUAGE',
#     'LANGUAGE_CODE', raise_error=True)
# PAGE_EXTRA_PERMISSIONS = getattr(settings, 'PAGE_EXTRA_PERMISSIONS', extra)
# PAGE_LANGUAGE_MAPPING = getattr(settings, 'PAGE_LANGUAGE_MAPPING', lambda l: l)
# SITE_ID = getattr(settings, 'SITE_ID', 1)
# PAGE_USE_SITE_ID = getattr(settings, 'PAGE_USE_SITE_ID', False)
# PAGE_HIDE_SITES = getattr(settings, 'PAGE_HIDE_SITES', False)
# PAGE_USE_LANGUAGE_PREFIX = getattr(settings, 'PAGE_USE_LANGUAGE_PREFIX',
#                                                                         False)
# PAGE_USE_STRICT_URL = getattr(settings, 'PAGE_USE_STRICT_URL', False)
# PAGE_CONTENT_REVISION_EXCLUDE_LIST = getattr(settings,
#     'PAGE_CONTENT_REVISION_EXCLUDE_LIST', ()
# )
# PAGE_SANITIZE_USER_INPUT = getattr(settings, 'PAGE_SANITIZE_USER_INPUT', False)
# PAGES_MEDIA_URL = get_setting('PAGES_MEDIA_URL')
#     PAGES_MEDIA_URL = str(media_url) + 'pages/'
# PAGE_HIDE_ROOT_SLUG = getattr(settings, 'PAGE_HIDE_ROOT_SLUG', False)
# PAGE_SHOW_START_DATE = getattr(settings, 'PAGE_SHOW_START_DATE', False)
# PAGE_SHOW_END_DATE = getattr(settings, 'PAGE_SHOW_END_DATE', False)
# PAGE_CONNECTED_MODELS = getattr(settings, 'PAGE_CONNECTED_MODELS', False)
# PAGE_LINK_FILTER = getattr(settings, 'PAGE_LINK_FILTER', False)
# PAGE_EXTRA_CONTEXT = getattr(settings, 'PAGE_EXTRA_CONTEXT', None)
# PAGE_UPLOAD_ROOT = getattr(settings, 'PAGE_UPLOAD_ROOT', 'upload')
# PAGE_ENABLE_TESTS = getattr(settings, 'PAGE_ENABLE_TESTS', False)
# PAGE_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
# PAGE_AUTOMATIC_SLUG_RENAMING = getattr(settings, 'PAGE_AUTOMATIC_SLUG_RENAMING', False)
# INSTALLED_APPS = getattr(settings, 'INSTALLED_APPS',
#                          ())
# FILEBROWSER_DIRECTORY = False
#     FILEBROWSER_DIRECTORY = getattr(settings, 'FILEBROWSER_DIRECTORY',
#                                     getattr(filebrowser_settigns, 'DIRECTORY', False))
# PAGE_ADD_API = getattr(settings, 'PAGE_ADD_API', True)
# 
# Path: basic_cms/api.py
# class BasicCMSAPI(APIView):
#     """
#     Get basic cms page by slug in given format
# 
#     format -- json/html, html = default
#     get-children -- true/false, true by default, works only with json.
# 
#     """
# 
#     permission_classes = (AllowAny,)
# 
#     def get(self, request, slug, *args, **kwargs):
#         format = request.GET.get('format', 'html')
#         get_children = request.GET.get('get-children', True)
#         lang = get_language()
#         page = Page.objects.from_path(slug, lang)
#         if page is None:
#             raise Http404("Page does not exist")
#         if format == 'html':
#             page = render_to_string(page.template, {'current_page': page}, request=request)
#             base_url = request.build_absolute_uri('/')
#             return Response({"html": links_append_domain(page, base_url)})
#         else:
#             page = page.dump_json_data(get_children=get_children)
#             return Response(page)


# Path: basic_cms/urls.py
from django.conf.urls import url, patterns
from basic_cms.views import details
from basic_cms import settings
from basic_cms.api import BasicCMSAPI

"""Django page CMS urls module."""



urlpatterns = patterns(
    '',
)

if settings.PAGE_ADD_API:
    urlpatterns += patterns('',
                            url(r'^basic-cms-api/(?P<slug>[-\w]+)/$', BasicCMSAPI.as_view(),
                                name='basic_cms_api'),
                            )



if settings.PAGE_USE_LANGUAGE_PREFIX: