diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b0f266669db9d5eaa4b256e713ce32ae3ebcc7c..b125750ccc15f94f11db68afd39ebf0c9d898803 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,4 +22,4 @@ deploy-job: - pip install -r requirements.txt - flask run & - echo "Now I'm Deploying to Heroku!" - - dpl --provider=heroku --app=yw21218-simplewebapp --api-key=5ccc3ae7-725e-4f9f-b441-0c9a28ebdc1b + - dpl --provider=heroku --app=metarl --api-key=5ccc3ae7-725e-4f9f-b441-0c9a28ebdc1b diff --git a/auto_augmentation/__init__.py b/auto_augmentation/__init__.py index 163f63b6b858fbd8600c16d3b57cfb9879bf386b..da6ac6a46769c882614ff0940d1535877c4728d7 100644 --- a/auto_augmentation/__init__.py +++ b/auto_augmentation/__init__.py @@ -2,7 +2,7 @@ import os from flask import Flask, render_template, request, flash -from auto_augmentation import home, progress, result, download_file +from auto_augmentation import home, progress,result def create_app(test_config=None): # create and configure the app @@ -21,6 +21,8 @@ def create_app(test_config=None): # ensure the instance folder exists os.makedirs(app.instance_path, exist_ok=True) + from auto_augmentation import download_file + app.register_blueprint(home.bp) app.register_blueprint(progress.bp) app.register_blueprint(result.bp) diff --git a/auto_augmentation/download_file.py b/auto_augmentation/download_file.py index c0dffa0cf02e281d4c60a2037b3e6fc230bdbe29..35b9f5a9fdb8b37351cffdc8ccf8d7f51cb131ba 100644 --- a/auto_augmentation/download_file.py +++ b/auto_augmentation/download_file.py @@ -3,10 +3,10 @@ from flask import Blueprint, request, render_template, flash, send_file bp = Blueprint("download_file", __name__) @bp.route("/download_file", methods=["GET"]) -@bp.route("/choose_file", methods=["GET", "POST"]) +@bp.route("/download", methods=["GET", "POST"]) def download(): # Setup for the 'return send_file()' function call at the end of this function path = 'templates/CNN.zip' # e.g. 'templates/download.markdown' - + return send_file(path, as_attachment=True) diff --git a/auto_augmentation/templates/result.html b/auto_augmentation/templates/result.html index 62c8a456352c7f262b78965c4ec7117cf655d487..6e127fdb1ed52f2abefc166f23dc7b8d25062f48 100644 --- a/auto_augmentation/templates/result.html +++ b/auto_augmentation/templates/result.html @@ -9,7 +9,9 @@ </div> <div> + <form action="/download"> <input type="submit" value='Download CNN'> + </form> </div> {% endblock %}