--- a/project/urls.py Tue Jul 20 02:51:29 2010 +0530
+++ b/project/urls.py Tue Jul 20 03:18:54 2010 +0530
@@ -1,9 +1,9 @@
-#django
from django.conf.urls.defaults import include
from django.conf.urls.defaults import patterns
from django.conf import settings
from django.contrib import admin
from django.views.generic.simple import direct_to_template
+from django.views.generic.simple import redirect_to
from django.conf.urls.defaults import *
admin.autodiscover()
@@ -15,19 +15,25 @@
# Admin
urlpatterns = patterns('',
- url(r'^$', direct_to_template, {"template": "home.html"}, name='home'),
+ url(r'^$', redirect_to, {'url': '/%s/' % (settings.CURRENT_SCOPE)}),
+ url(r'^%s/$' % (SCOPE_ARG_PATTERN),
+ direct_to_template, {"template": "home.html"}, name='home'),
(r'^comments/', include('django.contrib.comments.urls')),
(r'^admin/(.*)', admin.site.root),
)
# Talks, etc.
urlpatterns += patterns('project.scipycon.talk.views',
- url(r'^talks/$', 'list_talks', name='list_talks'),
- url(r'^talks/talk/(?P<id>\d+)/$', 'talk', name='talk_detail'),
- url(r'^submit-talk/$', 'submit_talk', name='scipycon_submit_talk'),
- url(r'^edit-talk/(?P<id>\d+)/$', 'edit_talk', name='scipycon_edit_talk'),
- url(r'^talks-cfp/list-talks/(?P<id>\d+)/$', 'list_talks',
- name='scipycon_list_talk'),
+ url(r'^%s/talks/$' % (SCOPE_ARG_PATTERN),
+ 'list_talks', name='list_talks'),
+ url(r'^%s/talks/talk/(?P<id>\d+)/$' % (SCOPE_ARG_PATTERN),
+ 'talk', name='talk_detail'),
+ url(r'^%s/submit-talk/$' % (SCOPE_ARG_PATTERN),
+ 'submit_talk', name='scipycon_submit_talk'),
+ url(r'^%s/edit-talk/(?P<id>\d+)/$' % (SCOPE_ARG_PATTERN),
+ 'edit_talk', name='scipycon_edit_talk'),
+ url(r'^%s/talks-cfp/list-talks/(?P<id>\d+)/$' % (SCOPE_ARG_PATTERN),
+ 'list_talks', name='scipycon_list_talk'),
)
# Registration
@@ -42,53 +48,61 @@
'download_csv', name="download_csv"),
)
-
# Authentication and Profile
urlpatterns += patterns('project.scipycon.user.views',
- url(r'^login/$', 'login', name='scipycon_login'),
- url(r'^logout/$', 'logout', name='scipycon_logout'),
- url(r'^account/$', 'account', name='scipycon_account'),
- url(r'^password/$', 'password', name='scipycon_password'), # change pwd
- url(r'^username/$', 'username', name='scipycon_username'), # change uname
- url(r'^edit-profile/$', 'edit_profile', name='scipycon_edit_profile'),
- url(r'^get-usernames/$', 'get_usernames', name='scipycon_get_usernames'),
+ url(r'^%s/login/$' % (SCOPE_ARG_PATTERN),
+ 'login', name='scipycon_login'),
+ url(r'^%s/logout/$' % (SCOPE_ARG_PATTERN),
+ 'logout', name='scipycon_logout'),
+ url(r'^%s/account/$' % (SCOPE_ARG_PATTERN),
+ 'account', name='scipycon_account'),
+ url(r'^%s/password/$' % (SCOPE_ARG_PATTERN),
+ 'password', name='scipycon_password'), # change pwd
+ url(r'^%s/username/$' % (SCOPE_ARG_PATTERN),
+ 'username', name='scipycon_username'), # change uname
+ url(r'^%s/edit-profile/$' % (SCOPE_ARG_PATTERN),
+ 'edit_profile', name='scipycon_edit_profile'),
+ url(r'^%s/get-usernames/$' % (SCOPE_ARG_PATTERN),
+ 'get_usernames', name='scipycon_get_usernames'),
)
# Proceedings
urlpatterns += patterns('project.scipycon.proceedings.views',
- url(r'^proceedings/submit/$', 'submit',
+ url(r'^%s/proceedings/submit/$' % (SCOPE_ARG_PATTERN), 'submit',
name='scipycon_submit_proceedings'),
- url(r'^proceedings/submit/(?P<id>\d+)/$', 'submit',
- name='scipycon_submit_proceedings'),
- url(r'^proceedings/show_paper/(?P<id>\d+)/$', 'show_paper',
- name='scipycon_show_paper'),
+ url(r'^%s/proceedings/submit/(?P<id>\d+)/$' % (SCOPE_ARG_PATTERN),
+ 'submit', name='scipycon_submit_proceedings'),
+ url(r'^%s/proceedings/show_paper/(?P<id>\d+)/$' % (SCOPE_ARG_PATTERN),
+ 'show_paper', name='scipycon_show_paper'),
)
# About pages and all other static html pages
urlpatterns += patterns('',
- url(r'^about/accommodation/$',
+ url(r'^%s/about/accommodation/$' % (SCOPE_ARG_PATTERN),
direct_to_template, {"template": "about/accommodation.html"},
name='scipycon_accommodation'),
- url(r'^about/food/$',
- direct_to_template, {"template": "about/food.html"}, name='scipycon_food'),
- url(r'^about/venue/$',
- direct_to_template, {"template": "about/venue.html"}, name='scipycon_venue'),
- url(r'^about/reaching/$',
+ url(r'^%s/about/food/$' % (SCOPE_ARG_PATTERN),
+ direct_to_template, {"template": "about/food.html"},
+ name='scipycon_food'),
+ url(r'^%s/about/venue/$' % (SCOPE_ARG_PATTERN),
+ direct_to_template, {"template": "about/venue.html"},
+ name='scipycon_venue'),
+ url(r'^%s/about/reaching/$' % (SCOPE_ARG_PATTERN),
direct_to_template, {"template": "about/reaching.html"},
name='scipycon_reaching'),
- url(r'^talks-cfp/$',
+ url(r'^%s/talks-cfp/$' % (SCOPE_ARG_PATTERN),
direct_to_template, {"template": "talk/talks-cfp.html"},
name='scipycon_talks_cfp'),
- url(r'^talks-cfp/schedule/$',
+ url(r'^%s/talks-cfp/schedule/$' % (SCOPE_ARG_PATTERN),
direct_to_template, {"template": "talk/schedule.html"},
name='scipycon_schedule'),
- url(r'^talks-cfp/tutorial/$',
+ url(r'^%s/talks-cfp/tutorial/$' % (SCOPE_ARG_PATTERN),
direct_to_template, {"template": "talk/tutorial-schedule.html"},
name='scipycon_tutorial_schedule'),
- url(r'^talks-cfp/sprint/$',
+ url(r'^%s/talks-cfp/sprint/$' % (SCOPE_ARG_PATTERN),
direct_to_template, {"template": "talk/sprint-schedule.html"},
name='scipycon_sprint_schedule'),
- url(r'^talks-cfp/speakers/$',
+ url(r'^%s/talks-cfp/speakers/$' % (SCOPE_ARG_PATTERN),
direct_to_template, {"template": "talk/speakers.html"},
name='scipycon_speakers'),
)