OLD | NEW |
1 import os | 1 import os |
2 from django.conf.urls import defaults | 2 from django.conf.urls import defaults |
3 from django.conf import settings | 3 from django.conf import settings |
4 | 4 |
5 # The next two lines enable the admin and load each admin.py file: | 5 # The next two lines enable the admin and load each admin.py file: |
6 from django.contrib import admin | 6 from django.contrib import admin |
7 admin.autodiscover() | 7 admin.autodiscover() |
8 | 8 |
9 RE_PREFIX = '^' + settings.URL_PREFIX | 9 RE_PREFIX = '^' + settings.URL_PREFIX |
10 TKO_RE_PREFIX = '^' + settings.TKO_URL_PREFIX | 10 TKO_RE_PREFIX = '^' + settings.TKO_URL_PREFIX |
11 PLANNER_RE_PREFIX = '^' + settings.PLANNER_URL_PREFIX | 11 PLANNER_RE_PREFIX = '^' + settings.PLANNER_URL_PREFIX |
| 12 CROSCHART_RE_PREFIX = '^' + settings.CROSCHART_URL_PREFIX |
12 | 13 |
13 handler404 = 'django.views.defaults.page_not_found' | 14 handler404 = 'django.views.defaults.page_not_found' |
14 handler500 = 'frontend.afe.views.handler500' | 15 handler500 = 'frontend.afe.views.handler500' |
15 | 16 |
16 urlpatterns = defaults.patterns( | 17 urlpatterns = defaults.patterns( |
17 '', | 18 '', |
18 (RE_PREFIX + r'admin/(.*)', admin.site.root), | 19 (RE_PREFIX + r'admin/(.*)', admin.site.root), |
19 (RE_PREFIX, defaults.include('frontend.afe.urls')), | 20 (RE_PREFIX, defaults.include('frontend.afe.urls')), |
20 (TKO_RE_PREFIX, defaults.include('frontend.tko.urls')), | 21 (TKO_RE_PREFIX, defaults.include('frontend.tko.urls')), |
21 (PLANNER_RE_PREFIX, defaults.include('frontend.planner.urls')), | 22 (PLANNER_RE_PREFIX, defaults.include('frontend.planner.urls')), |
| 23 (CROSCHART_RE_PREFIX, defaults.include('frontend.croschart.urls')), |
22 (RE_PREFIX + r'static/(?P<path>.*)', 'django.views.static.serve', | 24 (RE_PREFIX + r'static/(?P<path>.*)', 'django.views.static.serve', |
23 {'document_root': os.path.join(os.path.dirname(__file__), 'static')}), | 25 {'document_root': os.path.join(os.path.dirname(__file__), 'static')}), |
24 ) | 26 ) |
25 | 27 |
26 if os.path.exists(os.path.join(os.path.dirname(__file__), | 28 if os.path.exists(os.path.join(os.path.dirname(__file__), |
27 'tko', 'site_urls.py')): | 29 'tko', 'site_urls.py')): |
28 urlpatterns += defaults.patterns( | 30 urlpatterns += defaults.patterns( |
29 '', (TKO_RE_PREFIX, defaults.include('frontend.tko.site_urls'))) | 31 '', (TKO_RE_PREFIX, defaults.include('frontend.tko.site_urls'))) |
30 | 32 |
31 debug_patterns = defaults.patterns( | 33 debug_patterns = defaults.patterns( |
32 '', | 34 '', |
33 # redirect /tko and /results to local apache server | 35 # redirect /tko and /results to local apache server |
34 (r'^(?P<path>(tko|results)/.*)$', | 36 (r'^(?P<path>(tko|results)/.*)$', |
35 'frontend.afe.views.redirect_with_extra_data', | 37 'frontend.afe.views.redirect_with_extra_data', |
36 {'url': 'http://%(server_name)s/%(path)s?%(getdata)s'}), | 38 {'url': 'http://%(server_name)s/%(path)s?%(getdata)s'}), |
37 ) | 39 ) |
38 | 40 |
39 if settings.DEBUG: | 41 if settings.DEBUG: |
40 urlpatterns += debug_patterns | 42 urlpatterns += debug_patterns |
OLD | NEW |