Exemplo n.º 1
0
# -*- coding: utf-8 -*-
"""
Root url's map for application
"""
from django.conf.urls import *

from sveedocuments.models import ATTACHMENTS_WITH_SENDFILE
from sveedocuments.views.page import (
    HelpPageView, PageIndexView, PageDetailsView, 
    PageSourceView
)

urlpatterns = patterns('',
    url(r'^$', PageIndexView.as_view(), name='index'),
    
    (r'^board/', include('sveedocuments.urls_board')),
    
    url(r'^help/$', HelpPageView.as_view(), name='help'),
    
    url(r'^(?P<slug>[-\w]+)/$', PageDetailsView.as_view(), name='page-details'),
    url(r'^(?P<slug>[-\w]+)/source/$', PageSourceView.as_view(), name='page-source'),
)

if ATTACHMENTS_WITH_SENDFILE:
    from sveedocuments.views.attachment import AttachmentProtectedDownloadView
    urlpatterns += patterns('',
        url(r'^(?P<slug>[-\w]+)/attachment/(?P<attachment_id>\d+)/$', AttachmentProtectedDownloadView.as_view(), name='page-attachment-download'),
    )
Exemplo n.º 2
0
# -*- coding: utf-8 -*-
"""
Map your sveedocuments urls
"""
from sveedocuments.views.page import (HelpPageView, PageIndexView, PageDetailsView, 
                                    PageSourceView)

urlpatterns += patterns('',
    (r'^board/', include('sveedocuments.urls_board')),
    
    # Mount sveedocuments public ressources
    url(r'^documents-help/$', HelpPageView.as_view(), name='documents-help'),
    url(r'^sitemap/$', PageIndexView.as_view(), name='documents-index'),
    url(r'^(?P<slug>[-\w]+)/$', PageDetailsView.as_view(), name='documents-page-details'),
    url(r'^(?P<slug>[-\w]+)/source/$', PageSourceView.as_view(), name='documents-page-source'),
)
Exemplo n.º 3
0
from sveedocuments.views.page import HelpPageView, PageIndexView, PageDetailsView, PageSourceView

urlpatterns = patterns(
    '',
    url(r'^$',
        PageDetailsView.as_view(), {'slug': "accueil"},
        name='documents-homepage'),
    (r'^admin/', include(admin.site.urls)),
    (r'^accounts/', include('sveeaccounts.urls')),
    (r'^board/', include('sveedocuments.urls_board')),
    url(r'^captcha/', include('captcha.urls')),
    (r'^djangocodemirror-sample/', include('djangocodemirror.urls')),
    url(r'^tribune/', include('djangotribune.urls')),
    url(r'^documents-help/$', HelpPageView.as_view(), name='documents-help'),
    url(r'^sitemap/$', PageIndexView.as_view(), name='documents-index'),
    url(r'^(?P<slug>[-\w]+)/$',
        PageDetailsView.as_view(),
        name='documents-page-details'),
    url(r'^(?P<slug>[-\w]+)/source/$',
        PageSourceView.as_view(),
        name='documents-page-source'),
)

# En production (avec le debug_mode à False) ceci ne sera pas chargé
if settings.DEBUG:
    urlpatterns += patterns(
        '',
        (r'^medias/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.MEDIA_ROOT,
            'show_indexes': True