except ImportError:  # DROP_WITH_DJANGO13 # pragma: no cover
    from django.conf.urls.defaults import patterns, include, url

from armstrong.core.arm_sections.views import SimpleSectionView, SectionFeed
from .models import CustomSection
from .views import CustomSectionView


# DROP_WITH_DJANGO16
admin.autodiscover()


urlpatterns = patterns('',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^sections/(?P<full_slug>([\w\-\_]+/)+)$',
        SimpleSectionView.as_view(template_name='test_sections.html'),
        name='section_detail'),
    url(r'^feeds/sections/(?P<full_slug>([\w\-\_]+/)+)$',
        SectionFeed(section_view='section_detail'),
        name='section_feed'),
    url(r'^custom-sections/(?P<full_slug>([\w\-\_]+/)+)$',
        SimpleSectionView.as_view(template_name='test_sections.html',
                                  model=CustomSection),
        name='custom_section_detail'),
    url(r'^custom-sections-queryset/(?P<full_slug>([\w\-\_]+/)+)$',
        CustomSectionView.as_view(template_name='test_sections.html'),
        name='custom_section_queryset_detail'),
)

# for shell & runserver: Django 1.3 and 1.4 don't need this, but 1.5 does
# it will only work if DEBUG is True
Exemple #2
0
    # url(r'^baz/', include('baz.foo.urls')),

    # Comment the admin/doc line below to disable admin documentation:
    url(r'^%s/doc/' % ADMIN_BASE, include('django.contrib.admindocs.urls')),

    # Comment the next line to disable the admin:
    url(r'^%s/' % ADMIN_BASE, include(admin.site.urls)),
    url(r'^$',
        QuerySetBackedWellView.as_view(
            well_title='front_page',
            template_name="front_page.html",
            queryset=Article.published.all(),
        ),
        name='front_page'),
    url(r'^section/(?P<full_slug>[-\w/]+)',
        SimpleSectionView.as_view(template_name='section.html'),
        name='section_view'),
    url(r'^feed/section/(?P<full_slug>[-\w/]+)',
        SectionFeed(section_view='section_view'),
        name='section_feed'),
    url(r'^feed/all',
        ArticleFeed(title='Demo site articles',
                    link='/',
                    queryset=Article.objects.all()),
        name='all_articles_feed'),
    url(r'^article/(?P<slug>[-\w]+)/',
        paywall.protect(DetailView.as_view(
            queryset=Article.published.all(),
            template_name='article.html',
            slug_field='slug',
        ),
Exemple #3
0
            {'document_root': settings.MEDIA_ROOT}),

    # ## Creating a standard "front page"
    #
    # Below is an example of an adhoc QuerySetBackedWellView.  You should
    # uncomment it if you used `armstrong load_demo_data` to create your
    # initial data set.
    #
    url(r'^$',
            QuerySetBackedWellView.as_view(well_title="Front Page",
                    template_name="index.html",
                    queryset=Article.published.all()),
            name="home"),

    url(r'^section/(?P<full_slug>[-\w/]+)',
            SimpleSectionView.as_view(template_name='section.html'),
            name='section_view'),
    url(r'^feed/section/(?P<full_slug>[-\w/]+)',
            SectionFeed(section_view='section_view'),
            name='section_feed'),

    url(r'^feed/all',
            ArticleFeed(title='Demo site articles',
                        link='/',
                        queryset=Article.objects.all()),
            name='all_articles_feed'),

    url(r'^article/(?P<slug>[-\w]+)/', object_detail, {
                        'queryset': Article.published.all().select_subclasses(),
                        'template_name': 'article.html',
                        'slug_field': 'slug',
Exemple #4
0
from django.contrib import admin
from django.conf.urls.defaults import *

from armstrong.core.arm_sections.views import SimpleSectionView, SectionFeed

from .models import CustomSection
from .views import CustomSectionView

admin.autodiscover()

urlpatterns = patterns(
    '',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^sections/(?P<full_slug>([\w\-\_]+/)+)$',
        SimpleSectionView.as_view(template_name='test_sections.html'),
        name='section_detail'),
    url(r'^feeds/sections/(?P<full_slug>([\w\-\_]+/)+)$',
        SectionFeed(section_view='section_detail'),
        name='section_feed'),
    url(r'^custom-sections/(?P<full_slug>([\w\-\_]+/)+)$',
        SimpleSectionView.as_view(template_name='test_sections.html',
                                  model=CustomSection),
        name='custom_section_detail'),
    url(r'^custom-sections-queryset/(?P<full_slug>([\w\-\_]+/)+)$',
        CustomSectionView.as_view(template_name='test_sections.html'),
        name='custom_section_queryset_detail'),
)
 url(r"^%s/doc/" % ADMIN_BASE, include("django.contrib.admindocs.urls")),
 # Comment the next line to disable the admin:
 url(r"^%s/" % ADMIN_BASE, include(admin.site.urls)),
 url(r"^media/(?P<path>.*)$", "django.views.static.serve", {"document_root": settings.MEDIA_ROOT}),
 # Below is an example well view that might be used to display a well named
 # 'front_page' allowing for placement of content on the home page.  The view
 # works so long as there is a well with the title ``front_page`` present.
 url(
     r"^$",
     QuerySetBackedWellView.as_view(
         well_title="front_page", template_name="front_page.html", queryset=Article.published.all()
     ),
     name="front_page",
 ),
 url(
     r"^section/(?P<full_slug>[-\w/]+)", SimpleSectionView.as_view(template_name="section.html"), name="section_view"
 ),
 url(r"^feed/section/(?P<full_slug>[-\w/]+)", SectionFeed(section_view="section_view"), name="section_feed"),
 url(
     r"^feed/all",
     ArticleFeed(title="Demo site articles", link="/", queryset=Article.objects.all()),
     name="all_articles_feed",
 ),
 url(
     r"^article/(?P<slug>[-\w]+)/",
     object_detail,
     {
         "queryset": Article.published.all().select_subclasses(),
         "template_name": "article.html",
         "slug_field": "slug",
     },