I dont know why this gives an error but everything looks perfect i have tried so many times but this is not working i even gone through the stackoverflow answers nothing helped.I have another app which works fine with this same procfile and port but this gives an error.
The heroku log looks like this
2018-04-09T08:05:54.000000+00:00 app[api]: Build started by user [email protected]
2018-04-09T08:06:32.244340+00:00 app[api]: Deploy cdc01e38 by user [email protected]
2018-04-09T08:06:32.244340+00:00 app[api]: Release v31 created by user [email protected]
2018-04-09T08:05:54.000000+00:00 app[api]: Build succeeded
2018-04-09T08:09:55.988992+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=infinite-ridge-58576.herokuapp.com request_id=ca935db6-12ed-4332-ad05-4d7957bebece fwd="106.51.27.121" dyno= connect= service= status=503 bytes= protocol=https
2018-04-09T08:09:56.406479+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=infinite-ridge-58576.herokuapp.com request_id=65072529-5e63-4ac1-aa72-990359025bd2 fwd="106.51.27.121" dyno= connect= service= status=503 bytes= protocol=https
app.py
import os
import csv
import pandas as pd
from flask import Flask, render_template, request, send_file
import clearbit
import json
clearbit.key = 'yourkey'
app = Flask(__name__)
APP__ROOT = os.path.dirname(os.path.abspath(__file__))
@app.route("/")
def index():
return render_template("upload.html")
@app.route("/return-file/")
def return_file():
return send_file('new.csv', as_attachment=True)
@app.route("/upload", methods=['POST'])
def upload():
target = os.path.join(APP__ROOT)
print(target)
if not os.path.isdir(target):
os.mkdir(target)
for file in request.files.getlist("file"):
filename = file.filename
print(filename)
destination = "/".join([target, filename])
print(destination)
file.save(destination)
new_path = os.path.abspath(filename)
print(new_path)
df = pd.read_csv(new_path, sep=',', encoding="ISO-8859-1")
saved_column = df['Company'].dropna()
i = 0
res = []
for data in saved_column:
n = saved_column.get(i)
ns = len(n.split())
if ns > 4:
n = 'never get a website'
else:
print("a")
i = i + 1
print(n)
data = clearbit.NameToDomain.find(name=n)
print("\n")
print(data)
if data != None:
res.append(data['domain'])
else:
res.append('none.com')
print(res)
df['Domain'] = res
print(df['Domain'])
df.to_csv("new.csv", index=False)
downloadpath = "new.csv"
os.remove(os.path.abspath(new_path) )
return render_template("complete.html", name=downloadpath)
if __name__ == "__main__":
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port, debug=True)
Procfile
web: python app.py runserver 0.0.0.0:5000