-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
79 lines (67 loc) · 1.67 KB
/
app.py
File metadata and controls
79 lines (67 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import os
import sys
from django.conf import settings
from django.urls import path
from django.http import HttpResponse
from django.core.wsgi import get_wsgi_application
from django.template import RequestContext, Template
settings.configure(
DEBUG=False,
ALLOWED_HOSTS=["*"],
ROOT_URLCONF=__name__,
SECRET_KEY=os.environ.get("SECRET_KEY", "chnagethissecret"),
TEMPLATES=[{"BACKEND": "django.template.backends.django.DjangoTemplates"}],
MIDDLEWARE_CLASSES=(
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
),
)
def home(request):
context = RequestContext(
request, {"content": "Optional Content"}
)
return HttpResponse(MAIN_HTML.render(context))
urlpatterns = [
path("", home),
]
app = get_wsgi_application()
MAIN_HTML = Template(
"""
<html>
<head>
<title>The Company</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,body{
display: grid;
height: 100%;
width: 100%;
place-items: center;
}
.wrapper{
color: #3d3a2c;
max-width: 900px;
text-align: center;
padding: 0 50px;
}
</style>
</head>
<body>
<div class="wrapper">
<h1>The Company is under construction</h1>
<br>
<h3>Contact via hi@thecompany.com <h3>
</div>
</body>
</html>
"""
)
if __name__ == "__main__":
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)