2 # This file is part of my.gpodder.org.
4 # my.gpodder.org is free software: you can redistribute it and/or modify it
5 # under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or (at your
7 # option) any later version.
9 # my.gpodder.org is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
12 # License for more details.
14 # You should have received a copy of the GNU Affero General Public License
15 # along with my.gpodder.org. If not, see <http://www.gnu.org/licenses/>.
20 from django
.conf
.urls
.defaults
import *
21 from registration
.views
import activate
, register
22 from registration
.forms
import RegistrationFormUniqueEmail
23 from mygpo
.api
.models
import UserProfile
24 from django
.contrib
.auth
.views
import logout
27 # Uncomment the next two lines to enable the admin:
28 from django
.contrib
import admin
31 urlpatterns
= patterns('',
33 # (r'^mygpo/', include('mygpo.foo.urls')),
34 (r
'^$', 'mygpo.web.views.home'),
35 (r
'^login/$', 'mygpo.web.users.login_user'),
36 (r
'^logout/$', logout
, {'next_page': '/'}),
37 (r
'^migrate/$', 'mygpo.web.users.migrate_user'),
38 (r
'^register/resend-activation$', 'mygpo.web.views.resend_activation'),
39 (r
'^register/restore_password$', 'mygpo.web.users.restore_password'),
40 (r
'^register/$', register
, {'profile_callback': UserProfile
.objects
.create
, 'success_url': '../registration_complete/', 'form_class': RegistrationFormUniqueEmail
}),
41 (r
'^registration_complete/$', 'django.views.generic.simple.direct_to_template', {'template': 'registration/registration_complete.html'}),
42 (r
'^activate/(?P<activation_key>\w+)$', activate
),
44 (r
'^podcast/(?P<pid>\w+)$', 'mygpo.web.views.podcast'),
45 (r
'^podcast/(?P<pid>\w+)/subscribe$', 'mygpo.web.views.podcast_subscribe'),
46 (r
'^podcast/(?P<pid>\w+)/unsubscribe/(?P<device_id>\w+)', 'mygpo.web.views.podcast_unsubscribe'),
48 (r
'^episode/(?P<id>\d+)$', 'mygpo.web.views.episode'),
50 (r
'account/$', 'mygpo.web.views.account'),
51 (r
'account/delete$', 'mygpo.web.views.delete_account'),
53 (r
'^history/$', 'mygpo.web.views.history'),
54 (r
'^devices/$', 'mygpo.web.views.devices'),
56 (r
'^toplist/$', 'mygpo.web.views.toplist'),
57 (r
'^toplist.opml$', 'mygpo.web.views.toplist_opml', {'count': 50}),
59 (r
'^suggestions/$', 'mygpo.web.views.suggestions'),
61 (r
'^device/(?P<device_id>\d+)$', 'mygpo.web.views.device'),
62 (r
'^device/(?P<device_id>\d+)/sync$', 'mygpo.web.views.device_sync'),
63 (r
'^device/(?P<device_id>\d+)/unsync$', 'mygpo.web.views.device_unsync'),
64 (r
'^device/(?P<device_id>\d+)/delete$', 'mygpo.web.views.device_delete'),
65 (r
'^device/(?P<device_id>\d+)/history$', 'mygpo.web.views.history'),
67 (r
'^search/', include('haystack.urls')),
70 (r
'^upload$', 'mygpo.api.legacy.upload'),
71 (r
'^getlist$', 'mygpo.api.legacy.getlist'),
74 (r
'^subscriptions/(?P<username>\w+)/(?P<device_uid>\w+).(?P<format>\w+)', 'mygpo.api.simple.subscriptions'),
75 (r
'^toplist/(?P<count>\d+).(?P<format>\w+)', 'mygpo.api.simple.toplist'),
76 (r
'^search.(?P<format>\w+)', 'mygpo.api.simple.search'),
77 (r
'^suggestions/(?P<count>\d+).(?P<format>\w+)', 'mygpo.api.simple.suggestions'),
80 (r
'^api/1/subscriptions/(?P<username>\w+)/(?P<device_uid>\w+).json', 'mygpo.api.advanced.subscriptions'),
81 (r
'^api/1/episodes/(?P<username>\w+).json', 'mygpo.api.advanced.episodes'),
82 (r
'^api/1/devices/(?P<username>\w+)/(?P<device_uid>\w+).json', 'mygpo.api.advanced.device'),
83 (r
'^api/1/devices/(?P<username>\w+).json', 'mygpo.api.advanced.devices'),
85 #Subscribe with my.gpodder.org
86 (r
'^subscribe', 'mygpo.web.views.podcast_subscribe_url'),
87 #(r'^authors/$', 'django.views.generic.simple.direct_to_template', {'template': 'authors.html'}),
88 (r
'^authors/$', 'mygpo.web.views.author'),
91 (r
'^online-help', 'django.views.generic.simple.direct_to_template', {'template': 'online-help.html'}),
93 # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
94 # to INSTALLED_APPS to enable admin documentation:
95 # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
97 # Uncomment the next line to enable the admin:
98 (r
'^admin/(.*)', admin
.site
.root
),
100 (r
'^accounts/', include('registration.urls')),
102 (r
'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os
.path
.abspath('%s/../htdocs/media/' % os
.path
.dirname(__file__
))}),