-
Notifications
You must be signed in to change notification settings - Fork 0
/
fdonation.py
102 lines (76 loc) · 2.32 KB
/
fdonation.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
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 26 20:44:53 2021
@author: Sristi
"""
from django.http import HttpResponse
from django.template import loader
from django.template.loader import render_to_string
from django.template import engines
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from DaddyLongLegs import upgcinfo
from DaddyLongLegs import Money
from DaddyLongLegs import webparsing
#from gcinfo import *
#from webparsing import *
# from suject_match import *
#from upgcinfo import *
from DaddyLongLegs import surplus_funds
#from DaddyLongLegs import collect
@csrf_exempt
def totf(request):
f=open('buffer.txt','r')
name,budget,preference=f.readlines()
f.close()
mypart,yourpart=surplus_funds.BankKnows(float(budget),preference)
cont=(yourpart/mypart)*100
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;
background-image: url("{% static 'Images/child.jpg'%}");
background-size: cover;
}
* {
box-sizing: border-box;
}
.container {
padding: 16px;
background-color: rgb(19, 162, 228);
background-image: url("{% static 'Images/pink.jpg'%}");
height: 600px;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
text-align: center;
align-items: center;
}
.center {
margin: 0;
position: absolute;
top: 40%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
</style>
</head>
<body>
<div class="container">
<div class ="center">
<h1><b>THANKS TO YOU '''+name+''' , OUR TOTAL FUNDS ARE:'''+str(mypart)+'''
Congratulations! You contributed '''+str(cont)+''' %</b></h1>
</div>
</div>
<br><br>
</body>
</html>'''
django_engine=engines['django']
template=django_engine.from_string(about)
html=template.render()
return HttpResponse(html)