Feb-20-2019, 09:05 AM
Hi i have written a flask app that will allow user to upload images and those images will be saved in my local drive.
I am trying to upload that app into heroku, and everything went fine but when i run this app i receive
This is my python code
I am trying to upload that app into heroku, and everything went fine but when i run this app i receive
Error:2019-02-20T09:00:56.045524+00:00 heroku[web.1]: Process exited with status 3
2019-02-20T09:00:57.674515+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=04553316-6
517-49c4-b12b-814864271411 fwd="121.243.22.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:00.154847+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=ff15a32f-a
52f-4d00-909c-5f0ee8b6ae66 fwd="124.124.36.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:01.773539+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=c22471c8-2
da5-49ee-8714-77566d29bca3 fwd="121.243.22.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:03.030058+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=2043e88a-2
4f2-470c-ae23-0ab0d5591e62 fwd="121.243.22.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:04.336006+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=348d1a34-9
ac3-4f41-a272-37b7722662c2 fwd="124.124.36.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:05.695752+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=864ef90e-0
23f-4ded-9470-74ac624a317a fwd="124.124.36.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:06.802624+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=5ab704ac-8
dae-48bf-a46a-4753f181a85e fwd="124.124.36.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:07.877928+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=46759c8a-0
b85-4f18-8507-fffc669e7ac8 fwd="121.243.22.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:09.099555+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=f13fc550-f
2b0-4687-a65c-51711a0d060a fwd="124.124.36.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:11.180466+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=c8ff8aec-1
aab-47da-9fe4-53b2b8f72f94 fwd="124.124.36.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:13.308963+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=8c87348c-a
210-4bd7-8059-da14ed1afdd3 fwd="124.124.36.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:17.789765+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=d25beb2d-8
666-4517-ba65-b28bbf2be394 fwd="121.243.22.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:19.656581+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=4deb9b2d-9
03f-4785-a842-3009280ec1c2 fwd="121.243.22.130" dyno= connect= service= status=5
03 bytes= protocol=https
2019-02-20T09:01:21.015007+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=images99acres.herokuapp.com request_id=68b934d9-8
99f-4352-ba79-474726d2b406 fwd="124.124.36.130" dyno= connect= service= status=5
03 bytes= protocol=https
it says service crashed.This is my python code
from flask import Flask, redirect, render_template, request, session, url_for from flask_dropzone import Dropzone from flask_uploads import UploadSet, configure_uploads, IMAGES, patch_request_class import os app = Flask(__name__) dropzone = Dropzone(app) app.config['SECRET_KEY'] = 'supersecretkeygoeshere' # Dropzone settings app.config['DROPZONE_UPLOAD_MULTIPLE'] = True app.config['DROPZONE_ALLOWED_FILE_CUSTOM'] = True app.config['DROPZONE_ALLOWED_FILE_TYPE'] = 'image/*' app.config['DROPZONE_REDIRECT_VIEW'] = 'results' # Uploads settings app.config['UPLOADED_PHOTOS_DEST'] = os.getcwd() + '/uploads' photos = UploadSet('photos', IMAGES) configure_uploads(app, photos) patch_request_class(app) # set maximum file size, default is 16MB @app.route('/', methods=['GET', 'POST']) def index(): # set session for image results if "file_urls" not in session: session['file_urls'] = [] # list to hold our uploaded image urls file_urls = session['file_urls'] # handle image upload from Dropszone if request.method == 'POST': file_obj = request.files for f in file_obj: file = request.files.get(f) # save the file with to our photos folder filename = photos.save( file, name=file.filename ) # append image urls file_urls.append(photos.url(filename)) session['file_urls'] = file_urls return "uploading..." # return dropzone template on GET request return render_template('index.html') @app.route('/results') def results(): # redirect to home if no images to display if "file_urls" not in session or session['file_urls'] == []: return redirect(url_for('index')) # set the file_urls and remove the session variable file_urls = session['file_urls'] session.pop('file_urls', None) return render_template('results.html', file_urls=file_urls) if __name__=="__main__": app.run(debug=True) #app.run(debug=True)this is my procfile:
web: gunicorn app:app web: gunicorn run:appthis is the tutorial from where i am learning :https://medium.com/@gitaumoses4/deploying-a-flask-application-on-heroku-e509e5c76524