urls.py 1.56 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
admin.autodiscover()
10
11

urlpatterns = patterns('',
stef's avatar
stef committed
12
    (r'^$', bt.index),
stef's avatar
stef committed
13
    (r'^list/$', bt.list_violations),
stef's avatar
stef committed
14
    url(r'^list/(?P<country>[^/]*)(/(?P<operator>[^/]*))?$', bt.filter_violations, name="filter"),
15
    (r'^ajax/(?P<country>[^/]*)(/(?P<operator>[^/]*))?$', bt.ajax),
stef's avatar
stef committed
16
    (r'^add/$', bt.add),
17
    (r'^view/(?P<id>[0-9]*)$', bt.view),
stef's avatar
stef committed
18
    (r'^(?P<id>[0-9]*)$', bt.view),
stef's avatar
stef committed
19
20
    (r'^rss/$', RssSiteNewsFeed()),
    (r'^atom/$', AtomSiteNewsFeed()),
21
    (r'^activate/$', bt.activate),
stef's avatar
stef committed
22
23
    (r'^confirm/(?P<id>[0-9a-z]*)$', bt.confirm),
    (r'^confirm/(?P<id>[0-9]*)/(?P<name>.*)$', bt.confirm),
24
    (r'^moderate/$', bt.moderate),
stef's avatar
stef committed
25
    (r'^lookup/$', bt.lookup),
26
27
28
    (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
29
30
31
    (r'^about/$', direct_to_template, {'template': 'nn.html'}),
    (r'^start/$', direct_to_template, {'template': 'start.html'}),
    (r'^contact/$', direct_to_template, {'template': 'about.html'}),
32
33
    url(r'^captcha/', include('captcha.urls')),
    url(r'^admin/', include(admin.site.urls)),
34
35
36
37
38
39
)

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