addons-server/apps/versions/urls.py

28 строки
929 B
Python

from django.conf.urls.defaults import patterns, url
from versions.feeds import VersionsRss
from addons.urls import ADDON_ID
from . import views
urlpatterns = patterns('',
url('^$', views.version_list, name='addons.versions'),
url('^format:rss$', VersionsRss(), name='addons.versions.rss'),
url('^(?P<version_num>[^/]+)$', views.version_detail,
name='addons.versions'),
)
download_patterns = patterns('',
# .* at the end to match filenames.
# /file/:id/type:attachment
url('^file/(?P<file_id>\d+)(?:/type:(?P<type>\w+))?(?:/.*)?',
views.download_file, name='downloads.file'),
# /latest/1865/type:xpi/platform:5
url('^latest/%s/(?:type:(?P<type>\w+)/)?'
'(?:platform:(?P<platform>\d+)/)?.*' % ADDON_ID,
views.download_latest, name='downloads.latest'),
url('^watermarked/(?P<file_id>\d+)',
views.download_watermarked, name='downloads.watermarked'),
)