Add log_error decorator for debugging.
[matthijs/projects/xerxes.git] / urls.py
1 from django.conf import settings
2 from django.conf.urls.defaults import *
3 from django.contrib import admin
4 from xerxes.influences.models import Character
5 from xerxes.influences.models import Influence
6 import os
7
8 # Automatically import admin.py from all INSTALLED_APPS
9 admin.autodiscover()
10
11 urlpatterns = patterns('',
12     url(r'^$', 'django.views.generic.simple.redirect_to', {'url' : '/influences/'}),
13     (r'^admin/(.*)', admin.site.root),
14     url(r'^comments/', include('threadedcomments.urls')),
15
16     url(r'^influences/$', 'xerxes.influences.views.index', name='influences_index'),
17     url(r'^influences/influence/$', 'xerxes.influences.views.influence_list', name='influences_influence_list'),
18     url(r'^influences/influence/(?P<object_id>\d+)/$', 'xerxes.influences.views.influence_detail', name='influences_influence_detail'),
19     url(r'^influences/influence/(?P<object_id>\d+)/comment/$', 'xerxes.influences.views.influence_comment', name='influences_influence_comment'),
20     url(r'^influences/influence/(?P<object_id>\d+)/comment/(?P<parent_id>\d+)/$', 'xerxes.influences.views.influence_comment', name='influences_influence_comment_parent'),
21     url(r'^influences/influence/add/(\d+)/$', 'xerxes.influences.views.add_influence', name='influences_add_influence_for_character'),
22     url(r'^influences/influence/add/$', 'xerxes.influences.views.add_influence', name='influences_add_influence'),
23     
24     url(r'^influences/character/$', 'xerxes.influences.views.character_list', name='influences_character_list'),
25     url(r'^influences/character/(?P<object_id>\d+)/$', 'xerxes.influences.views.character_detail', name='influences_character_detail'),
26     url(r'^influences/character/add/$', 'xerxes.influences.views.add_character', name='influences_add_character'),
27
28     url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'base/login.html'}, name='login'),
29     url(r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login', name='logout'),
30 )
31
32 if settings.DEBUG:
33     urlpatterns += patterns('',
34         (r'^' + settings.MEDIA_URL[1:] + '(?P<path>.*)$', 'django.views.static.serve',
35         {'document_root': settings.MEDIA_ROOT}),
36     )
37 # vim: set sts=4 sw=4 expandtab: