-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallotvolun.py
112 lines (85 loc) · 2.98 KB
/
allotvolun.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
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 27 13:22:34 2021
@author: Sristi
"""
from django.http import HttpResponse
from django.template import loader
from django.views.decorators.csrf import csrf_exempt
from DaddyLongLegs import MASTER
from DaddyLongLegs import dbchild
from DaddyLongLegs import submatch
from django.template.loader import render_to_string
from django.template import engines
from django.template import RequestContext
from DaddyLongLegs import update
from DaddyLongLegs import waitlist
@csrf_exempt
def allot(request):
if request.method=='POST':
name=request.POST.get('name')
sub=request.POST.get('sub')
grade=request.POST.get('class')
status='You have been alloted Godparent to '
prelim=submatch.Matchmaker(grade,sub)
if not prelim:
status='You are on the Waitlist.<br>'
STATUS=waitlist.wl(name,grade,sub)
else:
STATUS=str(prelim)
update.update_subject(prelim,name)
about='''<html>
{%load static%}
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}
* {
box-sizing: border-box;
}
.container {
padding: 16px;
background-color: rgb(19, 162, 228);
background-image: url("{% static 'Images/yay.png'%}");
height: 1000px;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
text-align: center;
align-items: center;
}
.container3 {
height: 200px;
position: relative;
border: 3px solid green;
}
.center {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
hr {
border: 1px solid #141111;
margin-bottom: 30px;
}
</style>
</head>
<body>
<br>
<form method = 'POST'>
<div class="container">
<h1 style="font-size: 50px; font-family:Verdana; color:rgb(7, 7, 7);"><b>THANK YOU!</b></h1><br>
<br> <h2 style="font-size: 40px; color: #130e12;">Your Status is : '''+status+STATUS+'''
<br><br>
</h2></div>
</body>
</html>'''
django_engine=engines['django']
template=django_engine.from_string(about)
html=template.render()
return HttpResponse(html)