示例#1
0
文件: urls.py 项目: vlevit/vlevit.org
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.views.generic.base import RedirectView, TemplateView

from vlblog.views.utils import LanguageRedirectView
from vlblog.sitemaps import sitemaps


admin.autodiscover()


urlpatterns = patterns('',
    url(r'^$', LanguageRedirectView.as_view(url='/')),
    # favicon for apps ignoring icon link in html
    url(r'^favicon.ico$', RedirectView.as_view(
        url="{}/{}".format(settings.STATIC_URL, 'images/favicon.ico'))),
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap',
        {'sitemaps': sitemaps})
)

for rediction in settings.ENVIRON_REDIRECTIONS:
    urlpatterns += patterns(
        '', url(rediction[0], RedirectView.as_view(url=rediction[1]))
)

if settings.DEBUG:
    urlpatterns += patterns('',
示例#2
0
文件: urls.py 项目: vlevit/vlevit.org
from django.conf.urls import patterns, url
from vlblog.views.utils import LanguageRedirectView

from vlblog import feeds

urlpatterns = patterns(
    "vlblog.views.posts",
    # Redirections
    url(r"^$", LanguageRedirectView.as_view(url="/blog/tech/")),
    url(r"^blog/$", LanguageRedirectView.as_view(url="/blog/tech/")),
    # Pages
    url(r"^page/(?P<page>[\w-]+)/$", "page", name="page"),
    # Feeds
    url(r"^blog/?\.rss$", feeds.SiteFeed(), name="site_feed"),
    url(r"^blog/comments\.rss$", feeds.SiteCommentsFeed(), name="site_comments_feed"),
    url(r"^blog/(?P<blog>[\w-]+)/?\.rss$", feeds.BlogFeed(), name="blog_feed"),
    url(r"^blog/(?P<blog>[\w-]+)/tag/(?P<tag>[\w-]+)/?\.rss$", feeds.TagFeed(), name="tag_feed"),
    url(r"^blog/(?P<blog>[\w-]+)/comments\.rss$", feeds.BlogCommentsFeed(), name="blog_comments_feed"),
    url(
        r"^blog/(?P<blog>[\w-]+)/(?P<post>[\w-]+)(?:/comments)?\.rss$",
        feeds.PostCommentsFeed(),
        name="post_comments_feed",
    ),
    url(r"^page/(?P<page>[\w-]+)(?:/comments)?\.rss$", feeds.PageCommentsFeed(), name="page_comments_feed"),
    # Blog Posts
    url(r"^blog/(?P<blog>[\w-]+)/$", "post_list", name="post_list"),
    url(r"^blog/(?P<blog>[\w-]+)/tag/(?P<tag>.*)", "post_list", name="post_list_tag"),
    url(r"^blog/(?P<blog>[\w-]+)/page/(?P<page>[1-9][0-9]*)", "post_list", name="post_list_page"),
    url(r"^blog/(?P<blog>[\w-]+)/(?P<post>[\w-]+)", "post", name="post"),
)
示例#3
0
文件: urls.py 项目: lvboqi/vlevit.org
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.views.generic.base import RedirectView, TemplateView

from vlblog.views.utils import LanguageRedirectView
from vlblog.sitemaps import sitemaps

admin.autodiscover()

urlpatterns = patterns(
    '',
    url(r'^$', LanguageRedirectView.as_view(url='/')),
    # favicon for apps ignoring icon link in html
    url(
        r'^favicon.ico$',
        RedirectView.as_view(
            url="{}/{}".format(settings.STATIC_URL, 'images/favicon.ico'))),
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap',
        {'sitemaps': sitemaps}))

for rediction in settings.ENVIRON_REDIRECTIONS:
    urlpatterns += patterns(
        '', url(rediction[0], RedirectView.as_view(url=rediction[1])))

if settings.DEBUG:
    urlpatterns += patterns(
        '',
示例#4
0
文件: urls.py 项目: lvboqi/vlevit.org
from django.conf.urls import patterns, url
from vlblog.views.utils import LanguageRedirectView

from vlblog import feeds

urlpatterns = patterns(
    'vlblog.views.posts',

    # Redirections
    url(r'^$', LanguageRedirectView.as_view(url="/blog/tech/")),
    url(r'^blog/$', LanguageRedirectView.as_view(url="/blog/tech/")),

    # Pages
    url(r'^page/(?P<page>[\w-]+)/$', 'page', name='page'),

    # Feeds
    url(r'^blog/?\.rss$', feeds.SiteFeed(), name='site_feed'),
    url(r'^blog/comments\.rss$',
        feeds.SiteCommentsFeed(),
        name='site_comments_feed'),
    url(r'^blog/(?P<blog>[\w-]+)/?\.rss$', feeds.BlogFeed(), name='blog_feed'),
    url(r'^blog/(?P<blog>[\w-]+)/tag/(?P<tag>[\w-]+)/?\.rss$',
        feeds.TagFeed(),
        name='tag_feed'),
    url(r'^blog/(?P<blog>[\w-]+)/comments\.rss$',
        feeds.BlogCommentsFeed(),
        name='blog_comments_feed'),
    url(r'^blog/(?P<blog>[\w-]+)/(?P<post>[\w-]+)(?:/comments)?\.rss$',
        feeds.PostCommentsFeed(),
        name='post_comments_feed'),
    url(r'^page/(?P<page>[\w-]+)(?:/comments)?\.rss$',