Skip to content

Commit 0dadc74

Browse files
committed
Currency converter update (1)
1 parent 3befbea commit 0dadc74

4 files changed

Lines changed: 29 additions & 4 deletions

File tree

currency-converter/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.env
2+
__pycache__/
3+
*.pyc

currency-converter/app.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
from flask import Flask, render_template, request
22
import requests
33
import pycountry
4+
import os
5+
from dotenv import load_dotenv
6+
7+
# Load environment variables from .env
8+
load_dotenv()
49

510
app = Flask(__name__)
611

7-
# ✅ Directly put your API key here (⚠️ not for public sharing)
8-
API_KEY = "b22be4aca453b5cb0870cc2f"
12+
# Get API key from .env
13+
API_KEY = os.getenv("API_KEY")
14+
15+
if not API_KEY:
16+
raise ValueError("API key not found. Make sure API_KEY is set in .env")
17+
918
API_URL = f"https://v6.exchangerate-api.com/v6/{API_KEY}/pair"
1019

1120
# Get all ISO 4217 currencies (sorted)
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
flask
22
requests
3-
pycountry
3+
pycountry
4+
python-dotenv
5+
gunicorn

index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313

1414
<!-- reCAPTCHA -->
1515
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
16+
17+
<!-- MailerLite Universal -->
18+
<script>
19+
(function(w,d,e,u,f,l,n){w[f]=w[f]||function(){(w[f].q=w[f].q||[])
20+
.push(arguments);},l=d.createElement(e),l.async=1,l.src=u,
21+
n=d.getElementsByTagName(e)[0],n.parentNode.insertBefore(l,n);})
22+
(window,document,'script','https://assets.mailerlite.com/js/universal.js','ml');
23+
ml('account', '1922622');
24+
</script>
25+
<!-- End MailerLite Universal -->
26+
1627
</head>
1728

1829
<!-- Google tag -->
@@ -1028,7 +1039,7 @@ <h4>Thank you!</h4>
10281039

10291040
<h2> HellenicDev Updates: </h2>
10301041
<footer>
1031-
<p> I'm currently preparing for March. For those who don't know, 27 of March is the anniversary of HellenicDev. I would appreciate your opinion on the following: </p>
1042+
<p style="font-size: 30px;"> I'm currently preparing for March. For those who don't know, 27 of March is the anniversary of HellenicDev. I would appreciate your opinion on the following: </p>
10321043

10331044
<p style="font-size: 30px;"> 1.Sora AI video: </p>
10341045
<iframe width="560" height="315" src="https://www.youtube.com/embed/gJ9Liw12lZM?si=9DAoc0NPtVh7ajU8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

0 commit comments

Comments
 (0)