Commit
·
b5b2bc9
1
Parent(s):
b4ad87b
Update app.py
Browse files
app.py
CHANGED
|
@@ -119,11 +119,11 @@ Save generated details
|
|
| 119 |
"""
|
| 120 |
def save_data_and_sendmail(article,generated_questions,num_que):
|
| 121 |
try:
|
| 122 |
-
ip_address
|
| 123 |
-
ip_address
|
| 124 |
-
|
| 125 |
-
print(
|
| 126 |
-
add_csv = [article, generated_questions, num_que, ip_address]
|
| 127 |
print("data^^^^^",add_csv)
|
| 128 |
with open(DATA_FILE, "a") as f:
|
| 129 |
writer = csv.writer(f)
|
|
@@ -134,7 +134,7 @@ def save_data_and_sendmail(article,generated_questions,num_que):
|
|
| 134 |
|
| 135 |
url = 'https://pragnakalpdev35.pythonanywhere.com/HF_space_que_gen'
|
| 136 |
# url = 'http://pragnakalpdev33.pythonanywhere.com/HF_space_question_generator'
|
| 137 |
-
myobj = {'article': article,'total_que': num_que,'gen_que':generated_questions,'ip_addr':ip_address}
|
| 138 |
x = requests.post(url, json = myobj)
|
| 139 |
print("myobj^^^^^",myobj)
|
| 140 |
# with open(DATA_FILE, "r") as file:
|
|
|
|
| 119 |
"""
|
| 120 |
def save_data_and_sendmail(article,generated_questions,num_que):
|
| 121 |
try:
|
| 122 |
+
ip_address= getIP()
|
| 123 |
+
print(ip_address)
|
| 124 |
+
location = get_location(ip_address)
|
| 125 |
+
print(location)
|
| 126 |
+
add_csv = [article, generated_questions, num_que, ip_address,location]
|
| 127 |
print("data^^^^^",add_csv)
|
| 128 |
with open(DATA_FILE, "a") as f:
|
| 129 |
writer = csv.writer(f)
|
|
|
|
| 134 |
|
| 135 |
url = 'https://pragnakalpdev35.pythonanywhere.com/HF_space_que_gen'
|
| 136 |
# url = 'http://pragnakalpdev33.pythonanywhere.com/HF_space_question_generator'
|
| 137 |
+
myobj = {'article': article,'total_que': num_que,'gen_que':generated_questions,'ip_addr':ip_address,'loc':location}
|
| 138 |
x = requests.post(url, json = myobj)
|
| 139 |
print("myobj^^^^^",myobj)
|
| 140 |
# with open(DATA_FILE, "r") as file:
|