bornhack-website/src/bornhack/urls.py

210 lines
4.9 KiB
Python
Raw Normal View History

from allauth.account.views import (
LoginView,
LogoutView,
)
from django.conf import settings
from django.urls import include, path
2015-10-03 01:07:05 +00:00
from django.contrib import admin
from camps.views import *
from info.views import *
2016-12-28 23:15:13 +00:00
from villages.views import *
from program.views import *
from sponsors.views import *
from teams.views import *
2017-07-11 20:50:31 +00:00
from people.views import *
2017-08-26 01:48:02 +00:00
from bar.views import MenuView
2015-10-03 01:07:05 +00:00
urlpatterns = [
path(
'profile/',
2016-08-08 18:05:21 +00:00
include('profiles.urls', namespace='profiles')
),
path(
'tickets/',
include('tickets.urls', namespace='tickets')
),
path(
'shop/',
2016-08-08 18:05:21 +00:00
include('shop.urls', namespace='shop')
),
path(
'news/',
2016-08-08 18:05:21 +00:00
include('news.urls', namespace='news')
),
path(
'contact/',
2016-05-19 09:19:51 +00:00
TemplateView.as_view(template_name='contact.html'),
name='contact'
),
path(
'conduct/',
2016-06-06 15:33:25 +00:00
TemplateView.as_view(template_name='coc.html'),
name='conduct'
),
path(
'login/',
2016-02-20 22:39:02 +00:00
LoginView.as_view(),
name='account_login',
),
path(
'logout/',
LogoutView.as_view(),
name='account_logout',
),
path(
'privacy-policy/',
2016-06-01 12:08:24 +00:00
TemplateView.as_view(template_name='legal/privacy_policy.html'),
name='privacy-policy'
),
path(
'general-terms-and-conditions/',
2016-06-01 12:08:24 +00:00
TemplateView.as_view(template_name='legal/general_terms_and_conditions.html'),
name='general-terms'
),
path('accounts/', include('allauth.urls')),
path('admin/', admin.site.urls),
path(
'camps/',
2017-01-25 00:49:13 +00:00
CampListView.as_view(),
name='camp_list'
),
2018-08-18 13:26:49 +00:00
path(
'token/',
include('tokens.urls', namespace='tokens'),
),
2017-02-19 20:20:19 +00:00
# camp redirect views here
path(
'',
2017-02-19 20:20:19 +00:00
CampRedirectView.as_view(),
2017-03-09 23:01:14 +00:00
kwargs={'page': 'camp_detail'},
name='camp_detail_redirect',
2017-02-19 20:20:19 +00:00
),
path(
'program/',
2017-02-19 20:20:19 +00:00
CampRedirectView.as_view(),
2017-03-09 23:01:14 +00:00
kwargs={'page': 'schedule_index'},
name='schedule_index_redirect',
2017-02-19 20:20:19 +00:00
),
path(
'info/',
2017-02-19 20:20:19 +00:00
CampRedirectView.as_view(),
2017-03-09 23:01:14 +00:00
kwargs={'page': 'info'},
name='info_redirect',
2017-02-19 20:20:19 +00:00
),
path(
'sponsors/',
2017-02-19 20:20:19 +00:00
CampRedirectView.as_view(),
2017-03-09 23:01:14 +00:00
kwargs={'page': 'sponsors'},
name='sponsors_redirect',
2017-02-19 20:20:19 +00:00
),
path(
'villages/',
2017-02-19 20:20:19 +00:00
CampRedirectView.as_view(),
2017-03-09 23:01:14 +00:00
kwargs={'page': 'village_list'},
name='village_list_redirect',
2017-02-19 20:20:19 +00:00
),
path(
'people/',
2017-07-11 20:50:31 +00:00
PeopleView.as_view(),
2017-08-13 13:42:42 +00:00
name='people',
2017-07-11 20:50:31 +00:00
),
# camp specific urls below here
path(
'<slug:camp_slug>/', include([
path(
'',
2016-12-28 23:15:13 +00:00
CampDetailView.as_view(),
name='camp_detail'
),
2016-12-28 23:15:13 +00:00
path(
'info/',
2016-12-28 23:15:13 +00:00
CampInfoView.as_view(),
name='info'
),
2016-12-28 23:15:13 +00:00
path(
'program/',
include('program.urls', namespace='program'),
),
2016-12-28 23:15:13 +00:00
path(
'sponsors/',
SponsorsView.as_view(),
2016-12-28 23:15:13 +00:00
name='sponsors'
),
2016-12-28 23:15:13 +00:00
path(
'bar/menu/',
2017-08-26 01:48:02 +00:00
MenuView.as_view(),
name='menu'
),
path(
'villages/', include([
path(
'',
2016-12-28 23:15:13 +00:00
VillageListView.as_view(),
name='village_list'
2017-04-02 16:04:57 +00:00
),
path(
'create/',
2016-12-28 23:15:13 +00:00
VillageCreateView.as_view(),
name='village_create'
),
path(
'<slug:slug>/delete/',
2016-12-28 23:15:13 +00:00
VillageDeleteView.as_view(),
name='village_delete'
),
path(
'<slug:slug>/edit/',
2016-12-28 23:15:13 +00:00
VillageUpdateView.as_view(),
name='village_update'
),
2017-11-23 22:09:14 +00:00
# this has to be the last url in the list
path(
'<slug:slug>/',
2016-12-28 23:15:13 +00:00
VillageDetailView.as_view(),
name='village_detail'
),
])
),
path(
'teams/',
2017-11-23 22:09:14 +00:00
include('teams.urls', namespace='teams')
),
2017-11-23 22:09:14 +00:00
2018-08-08 20:18:39 +00:00
path(
'rideshare/',
include('rideshare.urls', namespace='rideshare')
),
path(
'backoffice/',
include('backoffice.urls', namespace='backoffice')
),
2017-11-23 22:09:14 +00:00
2016-12-28 23:15:13 +00:00
])
)
2015-10-03 01:07:05 +00:00
]
if settings.DEBUG:
import debug_toolbar
urlpatterns = [
path('__debug__/', include(debug_toolbar.urls)),
] + urlpatterns