-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
50 lines (35 loc) · 1.08 KB
/
app.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
from flask import Flask, request, render_template, jsonify
from datetime import date
import requests
import random
from dotenv import load_dotenv
import os
# Load environment variables from the .env.local file
load_dotenv('.env.local')
# Get the API key from the environment variable
api_key = os.getenv('API_KEY')
def list_all_languages():
# We will fill this out in a second
pass
def translatetext():
# We will fill this out in a second
pass
#### Defining Flask App
app = Flask(__name__)
#### Saving Date today in 2 different formats
datetoday = date.today().strftime("%m_%d_%y")
datetoday2 = date.today().strftime("%d-%B-%Y")
#### Our main page
### Our translate page
### Other endpoints
#### Our main function which runs the Flask App
if __name__ == '__main__':
app.run(debug=True)
### HELPFUL COMANDS
#
# To run our app:
# flask --app app.py --debug run
#
# You can also use the following command to run the app:
# flask run
# But this won't restart the server automatically when you make a change in the code. You will have to stop the server and run the command again.