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

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('go.views',

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

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

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

17
    # /my - My-Links page, view and review links.
18
    url(r'^my/?$', 'my_links', {'permission' : True}, name = 'my_links'),
19

20 21 22
    # /delete - Delete a link, no content display.
    url(r'^delete/(?P<short>\w+)$', 'delete', name = 'delete'),

23
    # /admin - Administrator interface.
24 25
    url(r'^admin/', include(admin.site.urls)),
)
26 27 28 29 30

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

    # Auth pages
    url(r'^login$', 'login', {'template_name' : 'login.html'},
31
        name='go_login'),
32
    url(r'^logout$', 'logout', {'next_page' : '/'},
33
        name='go_logout'),
34
)
Jean Michel Rouly's avatar
Jean Michel Rouly committed
35 36 37 38 39

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