# Modules
from django.conf.urls import url
from django_yaml_redirects import load_redirects
from django_template_finder_view import TemplateFinder
from ubuntudesign.gsa.views import SearchView

# Local
from webapp.views import custom_404, custom_500, MarkdownView

# Match any redirects first
urlpatterns = load_redirects()

default_markdown_template = "includes/base_markdown.html"

# Try to find templates
urlpatterns += [
    url(r"^search/?$", SearchView.as_view(template_name="pages/search.html")),
    url(
        r"^(?P<path>core(/.*)?)$",
        MarkdownView.as_view(),
        {"template_name": default_markdown_template},
    ),
    url(
        r"^(?P<path>community-resources(/.*)?)$",
        MarkdownView.as_view(),
        {"template_name": default_markdown_template},
    ),
    url(
        r"^(?P<path>snapcraft(/.*)?)$",
        MarkdownView.as_view(),
        {"template_name": default_markdown_template},
Exemplo n.º 2
0
from django.conf.urls import patterns, url

from django_yaml_redirects import load_redirects
from .views import UbuntuTemplateFinder, DownloadView, SearchView

urlpatterns = load_redirects()
urlpatterns += patterns(
    '',
    url(
        r'^(?P<template>download/(desktop|server|cloud)/thank-you)$',
        DownloadView.as_view()
    ),
    url(
        r'^(?P<template>download/desktop/contribute)$',
        DownloadView.as_view()
    ),
    url(r'^(?P<template>search)$', SearchView.as_view()),
    url(r'^(?P<template>.*)[^\/]$', UbuntuTemplateFinder.as_view()),
    url(r'$^', UbuntuTemplateFinder.as_view()),
)