# -*- coding: utf-8 -*- # Copyright (C) 1998-2012 by the Free Software Foundation, Inc. # # This file is part of HyperKitty. # # HyperKitty is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) # any later version. # # HyperKitty 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 General Public License for # more details. # # You should have received a copy of the GNU General Public License along with # HyperKitty. If not, see . # # Author: Aamir Khan # Author: Aurelien Bompard # from django.conf.urls.defaults import patterns, include, url from django.conf import settings from django.views.generic.simple import direct_to_template from api import EmailResource, ThreadResource, SearchResource from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib.auth.views import login as login_view from django.contrib.auth.views import logout as logout_view # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('hyperkitty.views', # Index url(r'^/$', 'pages.index', name='index'), url(r'^$', 'pages.index', name='root'), # Account url(r'^accounts/login/$', login_view, {'template_name': 'login.html'}, name='user_login'), url(r'^accounts/logout/$', logout_view, {'next_page': '/'}, name='user_logout'), url(r'^accounts/profile/$', 'accounts.user_profile', name='user_profile'), url(r'^accounts/register/$', 'accounts.user_registration', name='user_registration'), # List archives and overview url(r'^list/(?P[^/@]+@[^/@]+)/(?P\d{4})/(?P\d\d?)/(?P\d\d?)/$', 'list.archives', name='archives_with_day'), url(r'^list/(?P[^/@]+@[^/@]+)/(?P\d{4})/(?P\d\d?)/$', 'list.archives', name='archives_with_month'), url(r'^list/(?P[^/@]+@[^/@]+)/latest$', 'list.archives', name='archives_latest'), url(r'^list/(?P[^/@]+@[^/@]+)/$', 'list.overview', name='list_overview'), # Message url(r'^list/(?P[^/@]+@[^/@]+)/message/(?P\w+)/$', 'message.index', name='message_index'), url(r'^list/(?P[^/@]+@[^/@]+)/message/(?P\w+)/attachment/(?P\d+)/(?P.+)$', 'message.attachment', name='message_attachment'), url(r'^list/(?P[^/@]+@[^/@]+)/message/(?P\w+)/vote$', 'message.vote', name='message_vote'), url(r'^list/(?P[^/@]+@[^/@]+)/message/(?P\w+)/reply$', 'message.reply', name='message_reply'), url(r'^list/(?P[^/@]+@[^/@]+)/message/new$', 'message.new_message', name='message_new'), # Thread url(r'^list/(?P[^/@]+@[^/@]+)/thread/(?P\w+)/$', 'thread.thread_index', name='thread'), url(r'^list/(?P[^/@]+@[^/@]+)/thread/(?P\w+)/addtag$', 'thread.add_tag', name='add_tag'), url(r'^list/(?P[^/@]+@[^/@]+)/thread/(?P\w+)/favorite$', 'thread.favorite', name='favorite'), # Search Tag url(r'^list/(?P[^/@]+@[^/@]+)/tag/(?P.*)/$', 'list.search_tag', name='search_tag'), # Search url(r'^list/(?P[^/@]+@[^/@]+)/search/(?P.*)/(?P.*)/$', 'list.search_keyword', name="search_keyword"), url(r'^list/(?P[^/@]+@[^/@]+)/search/$', 'list.search', name="search_list"), # REST API url(r'^api/$', 'api.api'), url(r'^api/email\/(?P[^/@]+@[^/@]+)\/(?P.*)/', EmailResource.as_view(), name="api_email"), url(r'^api/thread\/(?P[^/@]+@[^/@]+)\/(?P.*)/', ThreadResource.as_view(), name="api_thread"), url(r'^api/search\/(?P[^/@]+@[^/@]+)\/(?P.*)\/(?P.*)/', SearchResource.as_view(), name="api_search"), # Uncomment the admin/doc line below to enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # Admin url(r'^admin/', include(admin.site.urls)), # Robots.txt url(r'^robots\.txt$', direct_to_template, {'template': 'robots.txt', 'mimetype': 'text/plain'}), # Social Auth url(r'', include('social_auth.urls')), # Mailman 2.X compatibility url(r'^listinfo/?$', 'compat.summary'), url(r'^listinfo/(?P[^/]+)/?$', 'compat.summary'), url(r'^pipermail/(?P[^/]+)/?$', 'compat.summary'), url(r'^pipermail/(?P[^/]+)/(?P\d\d\d\d)-(?P\w+)/?$', 'compat.arch_month'), url(r'^pipermail/(?P[^/]+)/(?P\d\d\d\d)-(?P\w+)/(?P[a-z]+)\.html$', 'compat.arch_month'), url(r'^pipermail/(?P[^/]+)/(?P\d\d\d\d)-(?P\w+)\.txt.gz', 'compat.arch_month_mbox'), url(r'^pipermail/(?P[^/]+)/(?P\d\d\d\d)-(?P\w+)/(?P\d+)\.html$', 'compat.message'), ) #) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += staticfiles_urlpatterns()