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

7

8
admin.autodiscover()
9
10

urlpatterns = patterns('',
stef's avatar
stef committed
11
    (r'^$', bt.index),
stef's avatar
stef committed
12
    (r'^list/$', bt.list_violations),
13
    (r'^ajax/(?P<country>[^/]*)(/(?P<operator>[^/]*))?$', bt.ajax),
stef's avatar
stef committed
14
    (r'^add/$', bt.add),
15
    (r'^view/(?P<id>[0-9]*)$', bt.view),
stef's avatar
stef committed
16
17
    (r'^rss/$', RssSiteNewsFeed()),
    (r'^atom/$', AtomSiteNewsFeed()),
18
    (r'^activate/$', bt.activate),
stef's avatar
stef committed
19
20
    (r'^confirm/(?P<id>[0-9a-z]*)$', bt.confirm),
    (r'^confirm/(?P<id>[0-9]*)/(?P<name>.*)$', bt.confirm),
21
    (r'^moderate/$', bt.moderate),
22
23
24
25
26
    (r'^accounts/logout$', 'django.contrib.auth.views.logout', {'next_page' : '/'}),
    (r'^accounts/', include('registration.urls')),
    (r'^comments/', include('django.contrib.comments.urls')),
    url(r'^captcha/', include('captcha.urls')),
    url(r'^admin/', include(admin.site.urls)),
27
28
29
30
31
32
)

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