Skip to content

Commit

Permalink
Add a 429 template and handler for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfischer committed Dec 16, 2024
1 parent f1a25ba commit b95a4e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
if settings.DEBUG:
# This allows the error pages to be debugged during development, just visit
# these url in browser to see how these error pages look like.
from allauth.core.ratelimit import _handler429 as handle_429 # noqa

urlpatterns += [
path(
"400/",
Expand All @@ -29,6 +31,7 @@
default_views.page_not_found,
kwargs={"exception": Exception("Page not Found")},
),
path("429/", handle_429),
path("500/", default_views.server_error),
]

Expand Down
9 changes: 9 additions & 0 deletions templates/429.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!doctype html>
<html lang="en">
<head>
<title>Too Many Requests (429)</title>
</head>
<body>
<h1>Too Many Requests (429)</h1>
</body>
</html>

0 comments on commit b95a4e8

Please sign in to comment.