# Path: django_flickr_gallery/settings.py
#     API_KEY = settings.FLICKR_API_KEY
#     SECRET = settings.FLICKR_SECRET
#     USER_ID = settings.FLICKR_USER_ID
# PHOTOSETS_LIST_TEMPLATE = getattr(settings, 'FLICKR_PHOTOSETS_LIST_TEMPLATE', "gallery/flickr/photoset_list.html")
# PHOTOS_LIST_TEMPLATE = getattr(settings, 'FLICKR_PHOTOS_LIST_TEMPLATE', "gallery/flickr/photo_list.html")
# PHOTOSET_LIST_VIEW = getattr(settings, 'FLICKR_PHOTOSET_LIST_VIEW', 'django_flickr_gallery.FlickrPhotosetListView')
# PHOTO_LIST_VIEW = getattr(settings, 'FLICKR_PHOTO_LIST_VIEW', 'django_flickr_gallery.FlickrPhotosListView')
# PAGINATOR_CLASS = Paginator
# PAGE_FIELD = getattr(settings, 'FLICKR_PAGE_FIELD', "page")
# PER_PAGE_FIELD = getattr(settings, 'FLICKR_PER_PAGE_FIELD', "per_page")
# PHOTOS_PER_PAGE = getattr(settings, 'FLICKR_PHOTOS_PER_PAGE', 10)
# PHOTOSETS_PER_PAGE = getattr(settings, 'FLICKR_PHOTOSETS_PER_PAGE', 10)
# CACHE = getattr(settings, 'FLICKR_CACHE', True)
# STORE_TOKEN = getattr(settings, 'FLICKR_STORE_TOKEN', False)
# CACHE_BACKEND = load_class(getattr(
#     settings,
#     'FLICKR_CACHE_BACKEND',
#     None))
# 
# Path: django_flickr_gallery/utils/import_tools.py
# def load_view(path):
#     """
#     Load view to urls patterns by path.
#     :param path:
#         Path of view.
#     :return: view func
#     """
#     app_name, view_name = path.split('.')
# 
#     absolute_path = '.'.join([app_name, 'views', view_name])
#     view = load_class(absolute_path)
# 
#     if issubclass(view, View):
#         return view.as_view()
# 
#     return view


from django.conf.urls import url
from django_flickr_gallery import settings
from django_flickr_gallery.utils.import_tools import load_view


photoset_list_view = load_view(getattr(settings, 'PHOTOSET_LIST_VIEW'))
photo_list_view = load_view(getattr(settings, 'PHOTO_LIST_VIEW'))


urlpatterns = [

# Path: django_flickr_gallery/settings.py
#     API_KEY = settings.FLICKR_API_KEY
#     SECRET = settings.FLICKR_SECRET
#     USER_ID = settings.FLICKR_USER_ID
# PHOTOSETS_LIST_TEMPLATE = getattr(settings, 'FLICKR_PHOTOSETS_LIST_TEMPLATE', "gallery/flickr/photoset_list.html")
# PHOTOS_LIST_TEMPLATE = getattr(settings, 'FLICKR_PHOTOS_LIST_TEMPLATE', "gallery/flickr/photo_list.html")
# PHOTOSET_LIST_VIEW = getattr(settings, 'FLICKR_PHOTOSET_LIST_VIEW', 'django_flickr_gallery.FlickrPhotosetListView')
# PHOTO_LIST_VIEW = getattr(settings, 'FLICKR_PHOTO_LIST_VIEW', 'django_flickr_gallery.FlickrPhotosListView')
# PAGINATOR_CLASS = Paginator
# PAGE_FIELD = getattr(settings, 'FLICKR_PAGE_FIELD', "page")
# PER_PAGE_FIELD = getattr(settings, 'FLICKR_PER_PAGE_FIELD', "per_page")
# PHOTOS_PER_PAGE = getattr(settings, 'FLICKR_PHOTOS_PER_PAGE', 10)
# PHOTOSETS_PER_PAGE = getattr(settings, 'FLICKR_PHOTOSETS_PER_PAGE', 10)
# CACHE = getattr(settings, 'FLICKR_CACHE', True)
# STORE_TOKEN = getattr(settings, 'FLICKR_STORE_TOKEN', False)
# CACHE_BACKEND = load_class(getattr(
#     settings,
#     'FLICKR_CACHE_BACKEND',
#     None))
# 
# Path: django_flickr_gallery/utils/import_tools.py
# def load_view(path):
#     """
#     Load view to urls patterns by path.
#     :param path:
#         Path of view.
#     :return: view func
#     """
#     app_name, view_name = path.split('.')
# 
#     absolute_path = '.'.join([app_name, 'views', view_name])
#     view = load_class(absolute_path)
# 
#     if issubclass(view, View):
#         return view.as_view()
# 
#     return view


# Path: django_flickr_gallery/urls.py
from django.conf.urls import url
from django_flickr_gallery import settings
from django_flickr_gallery.utils.import_tools import load_view



photoset_list_view = load_view(getattr(settings, 'PHOTOSET_LIST_VIEW'))
photo_list_view = load_view(getattr(settings, 'PHOTO_LIST_VIEW'))


urlpatterns = [

    url(r'^$', photoset_list_view, name='flickr-photoset-list'),