blob: 88d665894e00fafe29e77ae11023801d6fa3f2b7 [file] [log] [blame]
showardf828c772010-01-25 21:49:42 +00001import os
Aviv Keshet0a0029f2017-04-17 12:51:39 -07002from django.conf import urls
mblighe8819cd2008-02-15 16:48:40 +00003from django.conf import settings
4
showarda5288b42009-07-28 20:06:08 +00005# The next two lines enable the admin and load each admin.py file:
6from django.contrib import admin
7admin.autodiscover()
8
mblighe8819cd2008-02-15 16:48:40 +00009RE_PREFIX = '^' + settings.URL_PREFIX
showard250d84d2010-01-12 21:59:48 +000010TKO_RE_PREFIX = '^' + settings.TKO_URL_PREFIX
mblighe8819cd2008-02-15 16:48:40 +000011
showardf828c772010-01-25 21:49:42 +000012handler404 = 'django.views.defaults.page_not_found'
showard37c7fe62008-07-24 16:35:02 +000013handler500 = 'frontend.afe.views.handler500'
14
Aviv Keshet0a0029f2017-04-17 12:51:39 -070015urlpatterns = urls.patterns(
showardf7130722009-12-23 00:06:16 +000016 '',
Aviv Keshet0a0029f2017-04-17 12:51:39 -070017 (RE_PREFIX + r'admin/', urls.include(admin.site.urls)),
18 (RE_PREFIX, urls.include('frontend.afe.urls')),
19 (TKO_RE_PREFIX, urls.include('frontend.tko.urls')),
showarda5288b42009-07-28 20:06:08 +000020 )
showardff72fe32008-10-07 11:06:17 +000021
showard2edbd922010-01-20 01:11:01 +000022if os.path.exists(os.path.join(os.path.dirname(__file__),
23 'tko', 'site_urls.py')):
Aviv Keshet0a0029f2017-04-17 12:51:39 -070024 urlpatterns += urls.patterns(
25 '', (TKO_RE_PREFIX, urls.include('frontend.tko.site_urls')))
showard2edbd922010-01-20 01:11:01 +000026
Aviv Keshet0a0029f2017-04-17 12:51:39 -070027debug_patterns = urls.patterns(
showardf7130722009-12-23 00:06:16 +000028 '',
showarda5288b42009-07-28 20:06:08 +000029 # redirect /tko and /results to local apache server
30 (r'^(?P<path>(tko|results)/.*)$',
31 'frontend.afe.views.redirect_with_extra_data',
32 {'url': 'http://%(server_name)s/%(path)s?%(getdata)s'}),
33 )
showardff72fe32008-10-07 11:06:17 +000034
35if settings.DEBUG:
showardf7130722009-12-23 00:06:16 +000036 urlpatterns += debug_patterns