forked from lmorchard/badger2
/
urls.py
52 lines (35 loc) · 1.46 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
import badger
badger.autodiscover()
from badger import Progress
from badger_multiplayer.models import Badge, Award, Nomination
from session_csrf import anonymous_csrf_exempt
import django_browserid.views
urlpatterns = patterns('',
url(r'^$', 'badger.views.home', name='home'),
(r'', include('examples.urls')),
(r'^badges/', include('badger_multiplayer.urls')),
(r'^badges/', include('badger.urls')),
(r'^comments/', include('django.contrib.comments.urls')),
(r'^profiles/', include('profiles.urls')),
(r'^accounts/', include('django.contrib.auth.urls')),
(r'^accounts/', include('registration.backends.default.urls')),
(r'^admin/', include(admin.site.urls)),
#(r'^browserid/', include('django_browserid.urls')),
# HACK: CSRF troubles wth browserid auth
url(r'^browserid/verify/',
anonymous_csrf_exempt(django_browserid.views.verify),
name="browserid_verify"),
)
## In DEBUG mode, serve media files through Django.
if settings.DEBUG:
# Remove leading and trailing slashes so the regex matches.
media_url = settings.MEDIA_URL.lstrip('/').rstrip('/')
urlpatterns += patterns('',
(r'^%s/(?P<path>.*)$' % media_url, 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
)