urls.py 1.5 KB
Newer Older
1
from django.conf.urls import patterns, include, url
David Haynes's avatar
David Haynes committed
2 3
import go.views
import django.contrib.auth.views
4 5 6
from django.contrib import admin
admin.autodiscover()

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

David Haynes's avatar
David Haynes committed
10
urlpatterns = [
11
    # / - Homepage url.
David Haynes's avatar
David Haynes committed
12
    url(r'^$', go.views.index, name='index'),
13

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

17
    # /about - About page.
David Haynes's avatar
David Haynes committed
18
    url(r'^about/?$', go.views.about, name='about'),
19

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

23
    # /my - My-Links page, view and review links.
David Haynes's avatar
David Haynes committed
24
    url(r'^my/?$', go.views.my_links, name='my_links'),
25

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

29
    # /registered - registration complete page
David Haynes's avatar
David Haynes committed
30
    url(r'^registered/?$', go.views.registered, name='registered'),
31

32
    # /admin - Administrator interface.
David Haynes's avatar
David Haynes committed
33
    url(r'^admin/?', admin.site.urls),
34

Chris Reffett's avatar
Chris Reffett committed
35
    # /useradmin - user approval interface
David Haynes's avatar
David Haynes committed
36 37
    url(r'^useradmin/?$', go.views.useradmin, name='useradmin'),
]
38

David Haynes's avatar
David Haynes committed
39
urlpatterns += [
40
    # Auth pages
David Haynes's avatar
David Haynes committed
41 42
    url(r'^login$', django.contrib.auth.views.login, name='go_login'),
    url(r'^logout$', django.contrib.auth.views.logout, {'next_page': '/'},
43
        name='go_logout'),
David Haynes's avatar
David Haynes committed
44
]
Jean Michel Rouly's avatar
Jean Michel Rouly committed
45

David Haynes's avatar
David Haynes committed
46
urlpatterns += [
Jean Michel Rouly's avatar
Jean Michel Rouly committed
47
    # Redirection regex.
David Haynes's avatar
David Haynes committed
48 49 50
    url(r'^(?P<short>\w+)$', go.views.redirection, name='redirection'),

]
51

David Haynes's avatar
David Haynes committed
52 53
urlpatterns += [
    # Captcha support
54
    url(r'^captcha/', include('captcha.urls')),
David Haynes's avatar
David Haynes committed
55
]