Exemple #1
0
from django.conf.urls import url

from django.contrib import admin
admin.autodiscover()

from views import Main, Detail

app_name = "blog"

urlpatterns = [

    # Main view with optional page
    url(r'^$', Main.as_view(), name="Home"),
    url(r'^page/(?P<page>\d+)$', Main.as_view(), name="Home"),

    # Direct access by slug (one article - no paging)
    url(r'^article/(?P<slug>[\w-]+)$', Detail.as_view(), name="Detail"),

    # Search by tag (main article - supports paging)
    url(r'^search/(?P<tag_slug>[\w-]+)$', Main.as_view(), name="Search"),
    url(r'^search/(?P<tag_slug>[\w-]+)/page/(?P<page>\d+)$', Main.as_view(), name="Search"),

    # Search by date with paging
    url(r'^archive/(?P<year>\d{4})/$', Main.as_view(), name="Archive"),
    url(r'^archive/(?P<year>\d{4})/page/(?P<page>\d+)$', Main.as_view(), name="Archive"),
    url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})$', Main.as_view(), name="Archive"),
    url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})/page/(?P<page>\d+)$', Main.as_view(), name="Archive"),
]
Exemple #2
0
# -*- coding: utf-8 -*-
__author__ = 'jackdevil'

from django.conf.urls.defaults import patterns, include, url
from views import List, Detail

urlpatterns = patterns(
    '',
    url(r'^$', List.as_view(), name='metodical_bank.list'),
    url(r'^(?P<slug>\S+)/$', Detail.as_view(), name='metodical_bank.detail'),
)
Exemple #3
0
# -*- coding: utf-8 -*-
__author__ = 'jackdevil'

from django.conf.urls.defaults import patterns, include, url
from views import List, Detail

urlpatterns = patterns(
    '',
    url(r'^$', List.as_view(), name='schools.list'),
    url(r'^(?P<slug>\S+)/$', Detail.as_view(), name='schools.detail'),
)
Exemple #4
0
# -*- coding: utf-8 -*-
__author__ = 'jackdevil'

from django.conf.urls.defaults import patterns, include, url
from views import List, Detail

urlpatterns = patterns(
    '',
    url(r'^$', List.as_view(), name='your_choice.list'),
    url(r'^(?P<slug>\S+)/$', Detail.as_view(), name='your_choice.detail'),
)
Exemple #5
0
from django.contrib import admin
admin.autodiscover()

from views import Main, Detail

app_name = "blog"

urlpatterns = [

    # Main view with optional page
    url(r'^$', Main.as_view(), name="Home"),
    url(r'^page/(?P<page>\d+)$', Main.as_view(), name="Home"),

    # Direct access by slug (one article - no paging)
    url(r'^article/(?P<slug>[\w-]+)$', Detail.as_view(), name="Detail"),

    # Search by tag (main article - supports paging)
    url(r'^search/(?P<tag_slug>[\w-]+)$', Main.as_view(), name="Search"),
    url(r'^search/(?P<tag_slug>[\w-]+)/page/(?P<page>\d+)$',
        Main.as_view(),
        name="Search"),

    # Search by date with paging
    url(r'^archive/(?P<year>\d{4})/$', Main.as_view(), name="Archive"),
    url(r'^archive/(?P<year>\d{4})/page/(?P<page>\d+)$',
        Main.as_view(),
        name="Archive"),
    url(r'^archive/(?P<year>\d{4})/(?P<month>\d{2})$',
        Main.as_view(),
        name="Archive"),