welco/welco/urls.py

51 lines
2.0 KiB
Python

# welco - multichannel request processing
# Copyright (C) 2015 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
from . import apps
urlpatterns = patterns('',
url(r'^$', 'welco.views.home', name='home'),
url(r'^ajax/qualification$', 'welco.views.qualification', name='qualification'),
url(r'^kb/$', 'welco.kb.views.page_list', name='kb-home'),
url(r'^kb/add/$', 'welco.kb.views.page_add', name='kb-page-add'),
url(r'^kb/(?P<slug>[\w-]+)/$', 'welco.kb.views.page_detail', name='kb-page-view'),
url(r'^kb/(?P<slug>[\w-]+)/edit$', 'welco.kb.views.page_edit', name='kb-page-edit'),
url(r'^kb/(?P<slug>[\w-]+)/delete$', 'welco.kb.views.page_delete', name='kb-page-delete'),
url(r'^admin/', include(admin.site.urls)),
url(r'^logout/$', 'welco.views.logout', name='auth_logout'),
url(r'^login/$', 'welco.views.login', name='auth_login'),
(r'^ckeditor/', include('ckeditor.urls')),
)
if 'mellon' in settings.INSTALLED_APPS:
urlpatterns += patterns('', url(r'^accounts/mellon/', include('mellon.urls')))
# static and media files
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns()
from django.conf.urls.static import static
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns = apps.register_urls(urlpatterns)