aboutsummaryrefslogtreecommitdiff
path: root/glifestream/urls.py
blob: da6928bf7406445a64d68d319548c9365af90bcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#  gLifestream Copyright (C) 2009, 2010, 2013 Wojciech Polak
#
#  This program 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.
#
#  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 General Public License for more details.
#
#  You should have received a copy of the GNU General Public License along
#  with this program.  If not, see <http://www.gnu.org/licenses/>.

from django.conf import settings
from django.conf.urls import patterns, url, include
from django.contrib import admin
admin.autodiscover()

from glifestream.stream import views as sv

handler404 = 'glifestream.stream.views.page_not_found'

urlpatterns = patterns(
    '',
    url(r'^$', sv.index, name='index'),
    (r'^(?P<year>\d{4})/$', sv.index),
    (r'^(?P<year>\d{4})/(?P<month>\d{2})/$', sv.index),
    (r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$',
     sv.index),

    (r'^public/$', sv.index, {'ctx': 'public'}, 'public'),
    (r'^public/(?P<year>\d{4})/$', sv.index, {
    'ctx': 'public'}),
    (r'^public/(?P<year>\d{4})/(?P<month>\d{2})/$', sv.index,
     {'ctx': 'public'}),
    (r'^public/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$', sv.index,
     {'ctx': 'public'}),

    (r'^entry/(?P<entry>\d+)(/.*)?$', sv.index, {}, 'entry'),
    (r'^api/(?P<cmd>[a-z]+)$', sv.api),

    (r'^favorites/$', sv.index, {
     'ctx': 'favorites'}, 'favorites'),
    (r'^favorites/(?P<year>\d{4})/$', sv.index, {
     'ctx': 'favorites'}),
    (r'^favorites/(?P<year>\d{4})/(?P<month>\d{2})/$',
     sv.index, {'ctx': 'favorites'}),
    (r'^favorites/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$',
     sv.index, {'ctx': 'favorites'}),

    (r'^list/(?P<list>[a-z0-9\-]+)/$', sv.index, {}, 'list'),
    (r'^list/(?P<list>[a-z0-9\-]+)/(?P<year>\d{4})/$', sv.index),
    (r'^list/(?P<list>[a-z0-9\-]+)/(?P<year>\d{4})/(?P<month>\d{2})/$',
     sv.index),
    (r'^list/(?P<list>[a-z0-9\-]+)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$',
     sv.index),

    (r'^pshb/(?P<id>[a-f0-9]{20})$',
     sv.pshb_dispatcher, {}, 'pshb'),

    (r'^login/?$', 'glifestream.gauth.views.login'),
    (r'^logout/?$', 'django.contrib.auth.views.logout',
     {'next_page': './'}),

    (r'^auth/', include('glifestream.gauth.urls')),
    (r'^bookmarklet/', include(
     'glifestream.bookmarklet.urls')),
    (r'^settings/', include('glifestream.usettings.urls')),

    (r'^static/(?P<path>.*)$', 'django.views.static.serve',
     {'document_root': settings.MEDIA_ROOT}),
    (r'^admin/', include(admin.site.urls)),
)

Return to:

Send suggestions and report system problems to the System administrator.