import django
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

if django.VERSION[:2] > (1, 9):
    from django.views.i18n import JavaScriptCatalog
else:
    from django.views.i18n import javascript_catalog
    
from django_comments_xtd import LatestCommentFeed
from django_comments_xtd.views import XtdCommentListView

from comp import views


admin.autodiscover()


urlpatterns = [
    url(r'^$', views.HomepageView.as_view(), name='homepage'),
    url(r'^i18n/', include('django.conf.urls.i18n')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^articles/', include('comp.articles.urls')),
    url(r'^quotes/', include('comp.quotes.urls')),
    url(r'^comments/', include('django_comments_xtd.urls')),
    url(r'^comments/$', XtdCommentListView.as_view(
        content_types=["articles.article", "quotes.quote"],
        paginate_by=10, page_range=5),
        name='comments-xtd-list'),
    url(r'^feeds/comments/$', LatestCommentFeed(), name='comments-feed'),    
    url(r'^api-auth/', include('rest_framework.urls',
                               namespace='rest_framework')),
]

if django.VERSION[:2] > (1, 9):
    urlpatterns.append(
        url(r'^jsi18n/$', JavaScriptCatalog.as_view(),
            name='javascript-catalog')
    )
else:
    js_info_dict = {
        'packages': ('django_comments_xtd',)
    }
    urlpatterns.append(
        url(r'^jsi18n/$', javascript_catalog, js_info_dict,
            name='javascript-catalog')
    )

if settings.DEBUG:
    urlpatterns += staticfiles_urlpatterns()

if 'rosetta' in settings.INSTALLED_APPS:
    urlpatterns += [url(r'^rosetta/', include('rosetta.urls'))]

[((472, 492), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (490, 492), False, 'from django.contrib import admin\n'), ((1626, 1651), 'django.contrib.staticfiles.urls.staticfiles_urlpatterns', 'staticfiles_urlpatterns', ([], {}), '()\n', (1649, 1651), False, 'from django.contrib.staticfiles.urls import staticfiles_urlpatterns\n'), ((526, 554), 'comp.views.HomepageView.as_view', 'views.HomepageView.as_view', ([], {}), '()\n', (552, 554), False, 'from comp import views\n'), ((593, 625), 'django.conf.urls.include', 'include', (['"""django.conf.urls.i18n"""'], {}), "('django.conf.urls.i18n')\n", (600, 625), False, 'from django.conf.urls import include, url\n'), ((648, 672), 'django.conf.urls.include', 'include', (['admin.site.urls'], {}), '(admin.site.urls)\n', (655, 672), False, 'from django.conf.urls import include, url\n'), ((698, 727), 'django.conf.urls.include', 'include', (['"""comp.articles.urls"""'], {}), "('comp.articles.urls')\n", (705, 727), False, 'from django.conf.urls import include, url\n'), ((751, 778), 'django.conf.urls.include', 'include', (['"""comp.quotes.urls"""'], {}), "('comp.quotes.urls')\n", (758, 778), False, 'from django.conf.urls import include, url\n'), ((804, 839), 'django.conf.urls.include', 'include', (['"""django_comments_xtd.urls"""'], {}), "('django_comments_xtd.urls')\n", (811, 839), False, 'from django.conf.urls import include, url\n'), ((866, 978), 'django_comments_xtd.views.XtdCommentListView.as_view', 'XtdCommentListView.as_view', ([], {'content_types': "['articles.article', 'quotes.quote']", 'paginate_by': '(10)', 'page_range': '(5)'}), "(content_types=['articles.article',\n    'quotes.quote'], paginate_by=10, page_range=5)\n", (892, 978), False, 'from django_comments_xtd.views import XtdCommentListView\n'), ((1058, 1077), 'django_comments_xtd.LatestCommentFeed', 'LatestCommentFeed', ([], {}), '()\n', (1075, 1077), False, 'from django_comments_xtd import LatestCommentFeed\n'), ((1129, 1187), 'django.conf.urls.include', 'include', (['"""rest_framework.urls"""'], {'namespace': '"""rest_framework"""'}), "('rest_framework.urls', namespace='rest_framework')\n", (1136, 1187), False, 'from django.conf.urls import include, url\n'), ((1490, 1567), 'django.conf.urls.url', 'url', (['"""^jsi18n/$"""', 'javascript_catalog', 'js_info_dict'], {'name': '"""javascript-catalog"""'}), "('^jsi18n/$', javascript_catalog, js_info_dict, name='javascript-catalog')\n", (1493, 1567), False, 'from django.conf.urls import include, url\n'), ((1306, 1333), 'django.views.i18n.JavaScriptCatalog.as_view', 'JavaScriptCatalog.as_view', ([], {}), '()\n', (1331, 1333), False, 'from django.views.i18n import JavaScriptCatalog\n'), ((1732, 1755), 'django.conf.urls.include', 'include', (['"""rosetta.urls"""'], {}), "('rosetta.urls')\n", (1739, 1755), False, 'from django.conf.urls import include, url\n')]