urls.py 1.39 KB
Newer Older
1 2 3 4 5
from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

6 7 8
handle404 = "error_404"
handle500 = "error_500"

9 10
urlpatterns = patterns('go.views',

11
    # / - Homepage url.
12
    url(r'^$', 'index', name = 'index'),
13

Jean Michel Rouly's avatar
Jean Michel Rouly committed
14 15
    # /view/<short> - View URL data.
    url(r'^view/(?P<short>\w+)$', 'view', name = 'view'),
16

17 18 19
    # /about - About page.
    url(r'^about/?$', 'about', name = 'about'),

Jean Michel Rouly's avatar
Jean Michel Rouly committed
20 21 22
    # /signup - Signup page for access.
    url(r'^signup/?$', 'signup', name = 'signup'),

23
    # /my - My-Links page, view and review links.
24
    url(r'^my/?$', 'my_links', name = 'my_links'),
25

Jean Michel Rouly's avatar
Jean Michel Rouly committed
26
    # /delete/<short> - Delete a link, no content display.
27 28
    url(r'^delete/(?P<short>\w+)$', 'delete', name = 'delete'),

29 30 31
    # /registered - registration complete page
    url(r'^registered/?$', 'registered', name = 'registered'),

32
    # /admin - Administrator interface.
33
    url(r'^admin/?', include(admin.site.urls)),
34
)
35 36 37 38 39

urlpatterns += patterns('django.contrib.auth.views',

    # Auth pages
    url(r'^login$', 'login', {'template_name' : 'login.html'},
40
        name='go_login'),
41
    url(r'^logout$', 'logout', {'next_page' : '/'},
42
        name='go_logout'),
43
)
Jean Michel Rouly's avatar
Jean Michel Rouly committed
44 45 46 47 48

urlpatterns += patterns('go.views',
    # Redirection regex.
    url(r'^(?P<short>\w+)$', 'redirection', name = 'redirection'),
)
49 50 51 52 53

# Captcha support
urlpatterns += patterns('',
    url(r'^captcha/', include('captcha.urls')),
)