2019-03-26 08:53:06 +00:00
|
|
|
from allauth.account.views import LoginView, LogoutView
|
|
|
|
from django.conf.urls import include
|
2015-10-03 01:07:05 +00:00
|
|
|
from django.contrib import admin
|
2017-12-28 20:37:34 +00:00
|
|
|
from django.contrib.auth.decorators import login_required
|
2019-03-26 08:46:04 +00:00
|
|
|
from django.urls import path
|
2019-03-11 20:27:33 +00:00
|
|
|
from django.views.decorators.csrf import csrf_exempt
|
2019-03-11 19:26:36 +00:00
|
|
|
from graphene_django.views import GraphQLView
|
|
|
|
|
2019-03-26 08:46:04 +00:00
|
|
|
from bar.views import MenuView
|
2016-12-25 14:52:55 +00:00
|
|
|
from camps.views import *
|
2018-08-20 13:13:51 +00:00
|
|
|
from feedback.views import FeedbackCreate
|
2017-02-17 16:17:21 +00:00
|
|
|
from info.views import *
|
2019-03-26 08:46:04 +00:00
|
|
|
from people.views import *
|
2016-12-28 23:15:13 +00:00
|
|
|
from program.views import *
|
|
|
|
from sponsors.views import *
|
2019-03-26 08:46:04 +00:00
|
|
|
from villages.views import *
|
2015-10-03 01:07:05 +00:00
|
|
|
|
2017-12-30 23:16:07 +00:00
|
|
|
# require 2fa token entry (if enabled on admin account) when logging into /admin by using allauth login form
|
2017-12-28 20:37:34 +00:00
|
|
|
admin.site.login = login_required(admin.site.login)
|
|
|
|
|
2015-10-03 01:07:05 +00:00
|
|
|
urlpatterns = [
|
2019-06-16 12:32:24 +00:00
|
|
|
path("profile/", include("allauth.urls")),
|
|
|
|
path("profile/", include("allauth_2fa.urls")),
|
|
|
|
path("profile/", include("profiles.urls", namespace="profiles")),
|
|
|
|
path("tickets/", include("tickets.urls", namespace="tickets")),
|
|
|
|
path("shop/", include("shop.urls", namespace="shop")),
|
|
|
|
path("news/", include("news.urls", namespace="news")),
|
2018-05-23 21:28:27 +00:00
|
|
|
path(
|
2019-06-16 12:32:24 +00:00
|
|
|
"contact/", TemplateView.as_view(template_name="contact.html"), name="contact"
|
2017-08-19 20:06:32 +00:00
|
|
|
),
|
2019-06-16 12:32:24 +00:00
|
|
|
path("conduct/", TemplateView.as_view(template_name="coc.html"), name="conduct"),
|
|
|
|
path("login/", LoginView.as_view(), name="account_login"),
|
|
|
|
path("logout/", LogoutView.as_view(), name="account_logout"),
|
2018-05-23 21:28:27 +00:00
|
|
|
path(
|
2019-06-16 12:32:24 +00:00
|
|
|
"privacy-policy/",
|
|
|
|
TemplateView.as_view(template_name="legal/privacy_policy.html"),
|
|
|
|
name="privacy-policy",
|
2016-08-08 18:05:21 +00:00
|
|
|
),
|
2018-05-23 21:28:27 +00:00
|
|
|
path(
|
2019-06-16 12:32:24 +00:00
|
|
|
"general-terms-and-conditions/",
|
|
|
|
TemplateView.as_view(template_name="legal/general_terms_and_conditions.html"),
|
|
|
|
name="general-terms",
|
2016-08-08 18:05:21 +00:00
|
|
|
),
|
2019-06-16 12:32:24 +00:00
|
|
|
path("admin/", admin.site.urls),
|
2019-03-11 20:27:33 +00:00
|
|
|
# We don't need CSRF checks for the API
|
2019-06-16 12:32:24 +00:00
|
|
|
path("api/", csrf_exempt(GraphQLView.as_view(graphiql=True))),
|
|
|
|
path("camps/", CampListView.as_view(), name="camp_list"),
|
|
|
|
path("token/", include("tokens.urls", namespace="tokens")),
|
2017-02-19 20:20:19 +00:00
|
|
|
# camp redirect views here
|
2018-05-23 21:28:27 +00:00
|
|
|
path(
|
2019-06-16 12:32:24 +00:00
|
|
|
"",
|
2017-02-19 20:20:19 +00:00
|
|
|
CampRedirectView.as_view(),
|
2019-06-16 12:32:24 +00:00
|
|
|
kwargs={"page": "camp_detail"},
|
|
|
|
name="camp_detail_redirect",
|
2017-02-19 20:20:19 +00:00
|
|
|
),
|
2018-05-23 21:28:27 +00:00
|
|
|
path(
|
2019-06-16 12:32:24 +00:00
|
|
|
"program/",
|
2017-02-19 20:20:19 +00:00
|
|
|
CampRedirectView.as_view(),
|
2019-06-16 12:32:24 +00:00
|
|
|
kwargs={"page": "schedule_index"},
|
|
|
|
name="schedule_index_redirect",
|
2017-02-19 20:20:19 +00:00
|
|
|
),
|
2018-05-23 21:28:27 +00:00
|
|
|
path(
|
2019-06-16 12:32:24 +00:00
|
|
|
"info/",
|
2017-02-19 20:20:19 +00:00
|
|
|
CampRedirectView.as_view(),
|
2019-06-16 12:32:24 +00:00
|
|
|
kwargs={"page": "info"},
|
|
|
|
name="info_redirect",
|
2017-02-19 20:20:19 +00:00
|
|
|
),
|
2018-05-23 21:28:27 +00:00
|
|
|
path(
|
2019-06-16 12:32:24 +00:00
|
|
|
"sponsors/",
|
2017-02-19 20:20:19 +00:00
|
|
|
CampRedirectView.as_view(),
|
2019-06-16 12:32:24 +00:00
|
|
|
kwargs={"page": "sponsors"},
|
|
|
|
name="sponsors_redirect",
|
2017-02-19 20:20:19 +00:00
|
|
|
),
|
2018-05-23 21:28:27 +00:00
|
|
|
path(
|
2019-06-16 12:32:24 +00:00
|
|
|
"villages/",
|
2017-02-19 20:20:19 +00:00
|
|
|
CampRedirectView.as_view(),
|
2019-06-16 12:32:24 +00:00
|
|
|
kwargs={"page": "village_list"},
|
|
|
|
name="village_list_redirect",
|
2017-07-11 20:50:31 +00:00
|
|
|
),
|
2019-06-16 12:32:24 +00:00
|
|
|
path("people/", PeopleView.as_view(), name="people"),
|
2016-12-25 14:52:55 +00:00
|
|
|
# camp specific urls below here
|
2018-05-23 21:28:27 +00:00
|
|
|
path(
|
2019-06-16 12:32:24 +00:00
|
|
|
"<slug:camp_slug>/",
|
|
|
|
include(
|
|
|
|
[
|
|
|
|
path("", CampDetailView.as_view(), name="camp_detail"),
|
|
|
|
path("info/", CampInfoView.as_view(), name="info"),
|
|
|
|
path("program/", include("program.urls", namespace="program")),
|
|
|
|
path("sponsors/", SponsorsView.as_view(), name="sponsors"),
|
|
|
|
path("bar/menu/", MenuView.as_view(), name="menu"),
|
|
|
|
path(
|
|
|
|
"villages/",
|
|
|
|
include(
|
|
|
|
[
|
|
|
|
path("", VillageListView.as_view(), name="village_list"),
|
|
|
|
path(
|
|
|
|
"create/",
|
|
|
|
VillageCreateView.as_view(),
|
|
|
|
name="village_create",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"<slug:slug>/delete/",
|
|
|
|
VillageDeleteView.as_view(),
|
|
|
|
name="village_delete",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"<slug:slug>/edit/",
|
|
|
|
VillageUpdateView.as_view(),
|
|
|
|
name="village_update",
|
|
|
|
),
|
|
|
|
# this has to be the last url in the list
|
|
|
|
path(
|
|
|
|
"<slug:slug>/",
|
|
|
|
VillageDetailView.as_view(),
|
|
|
|
name="village_detail",
|
|
|
|
),
|
|
|
|
]
|
2016-12-28 23:15:13 +00:00
|
|
|
),
|
2019-06-16 12:32:24 +00:00
|
|
|
),
|
|
|
|
path("teams/", include("teams.urls", namespace="teams")),
|
|
|
|
path("rideshare/", include("rideshare.urls", namespace="rideshare")),
|
|
|
|
path("backoffice/", include("backoffice.urls", namespace="backoffice")),
|
|
|
|
path("feedback/", FeedbackCreate.as_view(), name="feedback"),
|
|
|
|
path("economy/", include("economy.urls", namespace="economy")),
|
|
|
|
]
|
|
|
|
),
|
|
|
|
),
|
2015-10-03 01:07:05 +00:00
|
|
|
]
|
2016-12-25 14:52:55 +00:00
|
|
|
|
2017-03-31 15:29:28 +00:00
|
|
|
if settings.DEBUG:
|
|
|
|
import debug_toolbar
|
2018-05-23 21:28:27 +00:00
|
|
|
|
2019-06-16 12:32:24 +00:00
|
|
|
urlpatterns = [path("__debug__/", include(debug_toolbar.urls))] + urlpatterns
|