Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbdd973d

Browse files
committed
Add heroku error page and timeout URL to test
1 parent1f65916 commitbdd973d

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

‎backend/heroku_error_page.html‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<htmllang="en">
2+
<head>
3+
<linkrel="stylesheet"href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"
4+
integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l"crossorigin="anonymous">
5+
<title>Error! - futurecoder</title>
6+
</head>
7+
<body>
8+
9+
<divclass="container">
10+
<h1>Error!</h1>
11+
12+
<p>
13+
The<strong>futurecoder</strong> servers are having some trouble right now. Try again in a few minutes.
14+
</p>
15+
16+
<p>
17+
In the meantime, you can<atarget="_blank"href="https://github.com/alexmojaki/futurecoder">read about futurecoder on
18+
GitHub</a>
19+
</p>
20+
21+
<h3><atarget="_blank"href="https://opencollective.com/futurecoder">Please consider donating to keep servers running</a></h3>
22+
23+
<p>
24+
This error is likely caused by too many users for the site to handle.
25+
<br>
26+
We need funds to run better hardware for longer, prevent these errors, and allow more users to learn how to
27+
code.
28+
<br>
29+
We want to avoid displaying ads or restricting content to paid users, so we rely on donations.
30+
</p>
31+
32+
<h3>Contact us:</h3>
33+
<ul>
34+
<li>
35+
<atarget="_blank"href="mailto:hello@futurecoder.io">
36+
Email hello@futurecoder.io
37+
</a>
38+
</li>
39+
<li>
40+
<atarget="_blank"href="https://github.com/alexmojaki/futurecoder/issues/new">
41+
Open an issue on GitHub
42+
</a>
43+
</li>
44+
<li>
45+
<atarget="_blank"href="https://join.slack.com/t/futurecoder/shared_invite/zt-l0zxo9d3-mimh7iTSaDB07hnePMNGFw">
46+
Chat on Slack
47+
</a>
48+
</li>
49+
</ul>
50+
</div>
51+
</body>
52+
53+
</html>

‎backend/main/urls.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
fromdjango.views.genericimportTemplateView
1919

2020
frommain.textimportchapters
21-
frommain.viewsimportFrontendAppView,HomePageView,api_view
21+
frommain.viewsimportFrontendAppView,HomePageView,api_view,timeout_view
2222

2323
home_view=HomePageView.as_view()
2424
urlpatterns= [
@@ -27,4 +27,5 @@
2727
path('',home_view),
2828
path('course/',ensure_csrf_cookie(FrontendAppView.as_view())),
2929
path('toc/',TemplateView.as_view(template_name="toc.html",extra_context=dict(chapters=chapters))),
30+
path('timeout/',timeout_view),
3031
]

‎backend/main/views.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
importtraceback
44
fromdatetimeimportdatetime
55
frompathlibimportPath
6+
fromtimeimportsleep
67
fromtypingimportget_type_hints
78
fromuuidimportuuid4
89

@@ -263,6 +264,10 @@ class Meta:
263264
fields= ["email"]
264265

265266

267+
deftimeout_view(request):
268+
sleep(35)
269+
270+
266271
deffix_birdseye_server():
267272
views=birdseye.server.app.view_functions
268273
birdseye.server.app.view_functions= {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp