apply new navigation to publisher pages
[mygpo.git] / mygpo / urls.py
blob8969cc0a78a577b11a34229e0117bfa6ff6bc8a1
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/>.
19 import os.path
20 from django.conf.urls.defaults import *
21 from registration.views import activate, register
22 from registration.forms import RegistrationFormUniqueEmail
23 from django.contrib.auth.views import logout
26 # Uncomment the next two lines to enable the admin:
27 from django.contrib import admin
28 admin.autodiscover()
30 urlpatterns = patterns('',
31 # Example:
32 # (r'^mygpo/', include('mygpo.foo.urls')),
33 (r'^$', 'mygpo.web.views.home'),
34 (r'^media/logo/(?P<size>\d+)/(?P<filename>[^/]*)\.jpg$', 'mygpo.web.views.cover_art'),
35 (r'^subscriptions/$', 'mygpo.web.views.subscriptions'),
36 (r'^login/$', 'mygpo.web.users.login_user'),
37 (r'^logout/$', logout, {'next_page': '/'}),
38 (r'^migrate/$', 'mygpo.web.users.migrate_user'),
39 (r'^register/resend-activation$', 'mygpo.web.views.resend_activation'),
40 (r'^register/restore_password$', 'mygpo.web.users.restore_password'),
41 (r'^register/$', register, {'backend': 'registration.backends.default.DefaultBackend', 'form_class': RegistrationFormUniqueEmail}),
42 (r'^registration_complete/$', 'django.views.generic.simple.direct_to_template', {'template': 'registration/registration_complete.html'}),
43 (r'^activate/(?P<activation_key>\w+)$', activate, {'backend': 'registration.backends.default.DefaultBackend'}),
45 (r'^podcast/(?P<pid>\w+)$', 'mygpo.web.views.podcast'),
46 (r'^podcast/(?P<pid>\w+)/subscribe$', 'mygpo.web.views.podcast_subscribe'),
47 (r'^podcast/(?P<pid>\w+)/unsubscribe/(?P<device_id>\d+)', 'mygpo.web.views.podcast_unsubscribe'),
49 (r'^episode/(?P<id>\d+)$', 'mygpo.web.views.episode.episode'),
50 (r'^episode/(?P<id>\d+)/add-chapter$', 'mygpo.web.views.episode.add_chapter'),
51 (r'^episode/(?P<id>\d+)/remove-chapter/(?P<chapter_id>\d+)$', 'mygpo.web.views.episode.remove_chapter'),
53 (r'account/$', 'mygpo.web.views.settings.account'),
54 (r'account/privacy$', 'mygpo.web.views.settings.privacy'),
55 (r'account/delete$', 'mygpo.web.views.settings.delete_account'),
56 (r'share/$', 'mygpo.web.views.settings.share'),
58 (r'user/(?P<username>\w+)/subscriptions$', 'mygpo.web.views.user_subscriptions'),
60 (r'^history/$', 'mygpo.web.views.history'),
61 (r'^devices/$', 'mygpo.web.views.devices'),
63 (r'^toplist/$', 'mygpo.web.views.toplist'),
64 (r'^toplist/episodes$', 'mygpo.web.views.episode_toplist'),
65 (r'^toplist.opml$', 'mygpo.web.views.toplist_opml', {'count': 50}),
67 (r'^suggestions/$', 'mygpo.web.views.suggestions'),
69 (r'^device/(?P<device_id>\d+)$', 'mygpo.web.views.device'),
70 (r'^device/(?P<device_id>\d+)/sync$', 'mygpo.web.views.device_sync'),
71 (r'^device/(?P<device_id>\d+)/unsync$', 'mygpo.web.views.device_unsync'),
72 (r'^device/(?P<device_id>\d+)/delete$', 'mygpo.web.views.device_delete'),
73 (r'^device/(?P<device_id>\d+)/history$', 'mygpo.web.views.history'),
75 (r'^search/', include('haystack.urls')),
77 #Legacy API
78 (r'^upload$', 'mygpo.api.legacy.upload'),
79 (r'^getlist$', 'mygpo.api.legacy.getlist'),
81 #Simple API
82 (r'^subscriptions/(?P<username>\w+)/(?P<device_uid>[\w.-]+)\.(?P<format>\w+)', 'mygpo.api.simple.subscriptions'),
83 (r'^toplist/(?P<count>\d+)\.(?P<format>\w+)', 'mygpo.api.simple.toplist'),
84 (r'^search\.(?P<format>\w+)', 'mygpo.api.simple.search'),
85 (r'^suggestions/(?P<count>\d+)\.(?P<format>\w+)', 'mygpo.api.simple.suggestions'),
87 #Advanced API
88 (r'^api/1/subscriptions/(?P<username>\w+)/(?P<device_uid>[\w.-]+)\.json', 'mygpo.api.advanced.subscriptions'),
89 (r'^api/1/episodes/(?P<username>\w+)\.json', 'mygpo.api.advanced.episodes'),
90 (r'^api/1/devices/(?P<username>\w+)/(?P<device_uid>[\w.-]+)\.json', 'mygpo.api.advanced.device'),
91 (r'^api/1/devices/(?P<username>\w+)\.json', 'mygpo.api.advanced.devices'),
93 (r'^api/2/auth/(?P<username>\w+)/(?P<device_uid>[\w.-]+)/login\.json', 'mygpo.api.advanced.auth.login'),
94 (r'^api/2/auth/(?P<username>\w+)/(?P<device_uid>[\w.-]+)/logout\.json', 'mygpo.api.advanced.auth.logout'),
95 (r'^api/2/auth/(?P<username>\w+)/(?P<device_uid>[\w.-]+)/validate\.json', 'mygpo.api.advanced.auth.validate'),
97 (r'^api/2/chapters/(?P<username>\w+)\.json', 'mygpo.api.advanced.episode.chapters'),
99 #Subscribe with my.gpodder.org
100 (r'^subscribe', 'mygpo.web.views.podcast_subscribe_url'),
103 (r'^online-help', 'django.views.generic.simple.direct_to_template', {'template': 'online-help.html'}),
105 # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
106 # to INSTALLED_APPS to enable admin documentation:
107 # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
109 # Uncomment the next line to enable the admin:
110 (r'^admin/(.*)', admin.site.root),
112 (r'^accounts/', include('registration.urls')),
114 (r'^publisher/$', 'mygpo.publisher.views.home'),
115 (r'^publisher/podcast/(?P<id>\d+)$', 'mygpo.publisher.views.podcast'),
116 (r'^publisher/podcast/(?P<id>\d+)/update$', 'mygpo.publisher.views.update_podcast'),
117 (r'^publisher/podcast/(?P<id>\d+)/episodes$', 'mygpo.publisher.views.episodes'),
118 (r'^publisher/episode/(?P<id>\d+)$', 'mygpo.publisher.views.episode'),
119 (r'^publisher/podcast/search$', 'mygpo.publisher.views.search_podcast'),
120 (r'^publisher/link/$', 'mygpo.publisher.views.link'),
122 #Subscribe with my.gpodder.org
123 (r'^subscribe', 'mygpo.web.views.podcast_subscribe_url'),
124 (r'^authors/$', 'mygpo.web.views.author'),
127 (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.path.abspath('%s/../htdocs/media/' % os.path.dirname(__file__))}),