-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviews.py
285 lines (230 loc) · 7.47 KB
/
views.py
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
from django.shortcuts import render
from django.http import HttpResponse
from . import pycode
# Create your views here.
def index(request):
x = pycode.main()
html = """<!DOCTYPE html>
<html lang="en">
<head>
<style>
html {
min-height: 100%;
}
body {
font-family: "IBM Plex Serif"; font-size: 16px;
margin: 2em;
background-image: linear-gradient(to bottom, #07BFEA 0%, #FFF 100%);
background-repeat: no-repeat;
min-height: 100%;
}
p.big {
font-family: "Times New Roman", Times, serif;
font-size: 40px;
font-weight: bold;
}
.button {
background-color: black;
color: white;
margin: 20px;
padding: 20px;
}
a:link, a:visited {
background-color: MediumBlue;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
}
a:hover, a:active {
background-color: DarkBlue;
}
#header {
font-family: "Bungee Shade";font-size: 40px;
}
</style>
<link href="https://fonts.googleapis.com/css?family=Bungee Shade" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=IBM Plex Serif" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1 align="center" id="header"><strong>Welcome to Pupper Supper!</strong></h1>
<br>""" + x + """
<img src="https://cdn.glitch.com/a1349faa-4c88-4763-a928-1d699be7ce17%2FDoggo.png?1549098926102" width="200" height="200" style = "margin-left:45%">
<p align="center" class="big">
Slo Hacks 2019
</p>
<div class="button">
<h2>What is Pupper Supper?</h2>
<p>Humans spend a lot of time trying to improve their health. There are even dedicated apps to help them in their journey to achieve physical wellbeing... but what about for man's best friend?
Our project, PupperSupper is dedicated to helping animals live a healthy life through checking food labels and ensuring that the ingredients in these foods are healthy for dogs to consume.</p>
<a href="./about" class="bowl">
<p>
About us
</p>
</a>
</div>
<div class="button">
<h2>How to get started</h2>
<p>The first thing you will need, of course, is your dog! Our goal is to add support for all pets including cats, horses, pigs, goats, and many more.
You need an active Internet connection (which you are probably using to read this right now) to run the Food Safety tool.</p>
</div>
<div class="button">
<h2>Food Safety Tool</h2>
<p>The pet food safety tool is an application that quickly tells you whether a particular human food is unhealthy or even deadly for your dog.</p>
<a href="./foodsafety" class="bowl">
<p>
How did we build it?
</p>
</a>
</div>
<h3>
<br>
<a href="./" class="bowl" style = "margin-left:30%">
<p>
<img src="https://cdn.glitch.com/a1349faa-4c88-4763-a928-1d699be7ce17%2Fbowl1.png?1549134065090">
Click to scan Item
</p>
</a>
</h3>
</body>
</html>
"""
return HttpResponse(html)
def foodsafety(request):
html = """<!DOCTYPE html>
<html lang="en">
<head>
<style>
html {
min-height: 100%;
}
body {
font-family: "IBM Plex Serif"; font-size: 16px;
margin: 2em;
background-image: linear-gradient(to bottom, #07BFEA 0%, #FFF 100%);
background-repeat: no-repeat;
min-height: 100%;
}
p.big {
font-family: "Times New Roman", Times, serif;
font-size: 40px;
font-weight: bold;
}
.button {
background-color: black;
color: white;
margin: 20px;
padding: 20px;
}
a:link, a:visited {
background-color: MediumBlue;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
}
a:hover, a:active {
background-color: DarkBlue;
}
#header {
font-family: "Bungee Shade";font-size: 40px;
}
</style>
<link href="https://fonts.googleapis.com/css?family=Sofia" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=IBM Plex Serif" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Food Safety</title>
</head>
<body>
<h1 align="center"><strong>The Pet Food Safety App</strong></h1>
<p align="center" class="big">
Powered by Google Vision API
</p>
<div class="button">
<h2>How it was made</h2>
<p>We programmed an app using Google Vision to scan the ingredients listed on the back of food items to see if the food is safe for your dog to eat or not.
The app will display the side effects of unhealthy and deadly ingredients. This app was written in Python and is powered by Django. </p>
</div>
</body>
</html>"""
return HttpResponse(html)
def about(request):
html = """<!DOCTYPE html>
<html lang="en">
<head>
<style>
html {
min-height: 100%;
}
body {
font-family: "IBM Plex Serif"; font-size: 16px;
margin: 2em;
background-image: linear-gradient(to bottom, #07BFEA 0%, #FFF 100%);
background-repeat: no-repeat;
min-height: 100%;
}
p.big {
font-family: "Times New Roman", Times, serif;
font-size: 40px;
font-weight: bold;
}
.button {
background-color: black;
color: white;
margin: 20px;
padding: 20px;
}
a:link, a:visited {
background-color: MediumBlue;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
}
a:hover, a:active {
background-color: DarkBlue;
}
#header {
font-family: "Bungee Shade";font-size: 40px;
}
</style>
<link href="https://fonts.googleapis.com/css?family=Sofia" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=IBM Plex Serif" rel="stylesheet">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>About us</title>
</head>
<body>
<h1 align="center"><strong>Pupper Supper Heroes</strong></h1>
<div class="button">
<h2>Abraham</h2>
<p><img src="https://cdn.glitch.com/a1349faa-4c88-4763-a928-1d699be7ce17%2Fbowl2.png?1549134070905" alt="idontgetthis" style="float:left;width:42px;height:42px;">
Programmed the food safety app using Python 3</p>
</div>
<div class="button">
<h2>Andrew</h2>
<p><img src="https://cdn.glitch.com/a1349faa-4c88-4763-a928-1d699be7ce17%2Fbowl2.png?1549134070905" alt="idontgetthis" style="float:left;width:42px;height:42px;">
Programmed part of the Python logic and built the Django backend for the web app.</p>
</div>
<div class="button">
<h2>Eric</h2>
<p><img src="https://cdn.glitch.com/a1349faa-4c88-4763-a928-1d699be7ce17%2Fbowl2.png?1549134070905" alt="idontgetthis" style="float:left;width:42px;height:42px;">
Developed the frontend of the website using HTML5 and CSS3</p>
</div>
<div class="button">
<h2>Zubair</h2>
<p><img src="https://cdn.glitch.com/a1349faa-4c88-4763-a928-1d699be7ce17%2Fbowl2.png?1549134070905" alt="idontgetthis" style="float:left;width:42px;height:42px;">
Worked on many parts of the project including web deployment. Acquired and set up our app's future URL, PupperSupper.com</p>
</div>
</body>
</html>"""
return HttpResponse(html)