-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
28 lines (22 loc) · 694 Bytes
/
app.py
File metadata and controls
28 lines (22 loc) · 694 Bytes
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
from flask import Flask, render_template
import pandas as pd
import random
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/exo_mass.html')
def ml_4():
return render_template('exo_mass.html')
@app.route('/stars_and_galaxies.html')
def sqg_5():
return render_template('stars_and_galaxies.html')
@app.route('/random_planet_url')
def random_planet_url():
data = pd.read_csv('hwc_table_all.csv')
planet = random.choice(data['Name'].tolist())
planet = planet.replace(" ", "")
url = f'https://exoplanetarchive.ipac.caltech.edu/overview/{planet}'
return url
if __name__ == '__main__':
app.run(debug = True)