Skip to content

Commit

Permalink
feat(core): add base api url (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
MagneticNeedle authored Jul 23, 2023
2 parents 5caad84 + 89713f7 commit 39941c2
Showing 1 changed file with 38 additions and 30 deletions.
68 changes: 38 additions & 30 deletions bfportal/bfportal/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,50 @@
path("admin/", include(wagtailadmin_urls)),
path("documents/", include(wagtaildocs_urls)),
# allow only social login :)
path("password/change/", RedirectView.as_view(url="/")),
path("password/set/", RedirectView.as_view(url="/")),
path("password/reset/", RedirectView.as_view(url="/")),
path("password/reset/done/", RedirectView.as_view(url="/")),
re_path(
"^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$",
RedirectView.as_view(url="/"),
),
path("password/reset/key/done/", RedirectView.as_view(url="/")),
path("email/", RedirectView.as_view(url="/")),
path("confirm-email/", RedirectView.as_view(url="/")),
re_path("^confirm-email/(?P<key>[-:\\w]+)/$", RedirectView.as_view(url="/")),
path("signup/", RedirectView.as_view(url="/")),
*[
path("password/change/", RedirectView.as_view(url="/")),
path("password/set/", RedirectView.as_view(url="/")),
path("password/reset/", RedirectView.as_view(url="/")),
path("password/reset/done/", RedirectView.as_view(url="/")),
re_path(
"^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$",
RedirectView.as_view(url="/"),
),
path("password/reset/key/done/", RedirectView.as_view(url="/")),
path("email/", RedirectView.as_view(url="/")),
path("confirm-email/", RedirectView.as_view(url="/")),
re_path("^confirm-email/(?P<key>[-:\\w]+)/$", RedirectView.as_view(url="/")),
path("signup/", RedirectView.as_view(url="/")),
],
# go straight to discord login
path("login/", RedirectView.as_view(url="/discord/login/?process=login")),
path("", include("allauth.urls")),
path(
"api/categories/",
CategoriesAutocomplete.as_view(),
name="category-autocomplete",
),
path("api/tags/", TagsAutocomplete.as_view(), name="tags-autocomplete"),
re_path(r"^api/report/(\d+)/$", report_experience, name="report-experience"),
re_path(
r"^api/like/(\d+)/$",
handle_like_request,
name="add_like_to_experience_page",
),
path("api/", api_router.urls),
*[
path("login/", RedirectView.as_view(url="/discord/login/?process=login")),
path("", include("allauth.urls")),
],
# api urls
*[
path(
"api/categories/",
CategoriesAutocomplete.as_view(),
name="category-autocomplete",
),
path("api/tags/", TagsAutocomplete.as_view(), name="tags-autocomplete"),
re_path(r"^api/report/(\d+)/$", report_experience, name="report-experience"),
re_path(
r"^api/like/(\d+)/$",
handle_like_request,
name="add_like_to_experience_page",
),
path("api/", api_router.urls),
re_path(
"^api/$", TemplateView.as_view(template_name="coming_soon.html")
), # todo: add correct api docs
],
re_path(r"^ajax_select/", include(ajax_select_urls)),
path("markdownx/", include("markdownx.urls")),
path("events/", events_view, name="events-view"),
]


if settings.DEBUG:
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
Expand All @@ -69,7 +78,6 @@
urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


urlpatterns = urlpatterns + [
# For anything not caught by a more specific rule above, hand over to
# Wagtail's page serving mechanism. This should be the last pattern in
Expand Down

0 comments on commit 39941c2

Please sign in to comment.