urls.py 1.77 KB
Newer Older
1
from django.conf.urls.defaults import patterns, include, url
stef's avatar
stef committed
2
from django.views.generic.simple import direct_to_template
3
from django.conf import settings
4
from django.contrib import admin
5
from bt import views as bt
stef's avatar
stef committed
6 7
from bt.feeds import RssSiteNewsFeed, AtomSiteNewsFeed

8 9 10 11
from bt.api import APIResource

api_resource = APIResource()

12

13
admin.autodiscover()
14 15

urlpatterns = patterns('',
stef's avatar
stef committed
16
    (r'^$', bt.index),
stef's avatar
stef committed
17
    (r'^list/$', bt.list_violations),
stef's avatar
stef committed
18
    url(r'^list/(?P<country>[^/]*)(/(?P<operator>[^/]*))?$', bt.filter_violations, name="filter"),
19 20
    #(r'^ajax/(?P<country>[^/]*)(/(?P<operator>[^/]*))?$', bt.ajax),
    (r'^api/', include(api_resource.urls)),
stef's avatar
stef committed
21
    (r'^add/$', bt.add),
22
    (r'^view/(?P<id>[0-9]*)$', bt.view),
23
    (r'^attach/(?P<id>[0-9]*)$', bt.get_attach),
stef's avatar
stef committed
24
    (r'^(?P<id>[0-9]*)$', bt.view),
25
    (r'^csv$', bt.ascsv),
26
    (r'^ods$', bt.asods),
stef's avatar
stef committed
27 28
    (r'^rss/$', RssSiteNewsFeed()),
    (r'^atom/$', AtomSiteNewsFeed()),
29
    (r'^activate/$', bt.activate),
stef's avatar
stef committed
30 31
    (r'^confirm/(?P<id>[0-9a-z]*)$', bt.confirm),
    (r'^confirm/(?P<id>[0-9]*)/(?P<name>.*)$', bt.confirm),
32
    (r'^moderate/$', bt.moderate),
stef's avatar
stef committed
33
    (r'^lookup/$', bt.lookup),
34 35 36
    (r'^accounts/logout$', 'django.contrib.auth.views.logout', {'next_page' : '/'}),
    (r'^accounts/', include('registration.urls')),
    (r'^comments/', include('django.contrib.comments.urls')),
stef's avatar
stef committed
37 38 39
    (r'^about/$', direct_to_template, {'template': 'nn.html'}),
    (r'^start/$', direct_to_template, {'template': 'start.html'}),
    (r'^contact/$', direct_to_template, {'template': 'about.html'}),
40 41
    url(r'^captcha/', include('captcha.urls')),
    url(r'^admin/', include(admin.site.urls)),
42 43 44 45 46 47
)

if settings.DEV_SERVER:
    urlpatterns += patterns('',
        (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_PATH}),
    )