Hello, The code below runs without any problems if the HTML file i'm rendering is called footprint.html, if I change the name i get an internal server error. the file is still generated but the page is not accessible 500 error. here is the code
@app.route('/maps')
def home():
df = pd.read_csv("/home/user_name/bloodtypes/abo.csv", delimiter=',')
df.columns = df.columns.str.strip()
political_countries_url = (
"http://geojson.xyz/naturalearth-3.3.0/ne_50m_admin_0_countries.geojson"
)
m = folium.Map(location=(30, 10), zoom_start=3, tiles="cartodb positron")
folium.Choropleth(
geo_data=political_countries_url,
data=df,
columns=("Country", "O", "A", "B"),
key_on="feature.properties.name",
fill_color="RdYlGn_r",
fill_opacity=0.8,
line_opacity=0.3,
nan_fill_color="white",
legend_name="Blood type distribution by country",
).add_to(m)
m.save("/home/user_name/bloodtypes/maps/templates/footprint.html")
return render_template("footprint.html")
Would greatly appreciate any help. Thanks in advance!
[edit by admin: formatting]