-1

I have created routes like the following in the graph.py file

bp = Blueprint('graph', __name__, url_prefix='/')

from flask import jsonify
@bp.route("/", methods=("GET", "POST"))
def index():
    return render_template("graph/index.html")

@bp.route("/patent", methods=(['GET', 'POST']))
def patent():
    return render_template("graph/patent.html")

@bp.route("/literature", methods=("GET", "POST"))
def literature():
    return render_template("graph/literature.html")

it is working fine on my localhost(windows) but on the server(Ubuntu 18) it runs the simple route ('/') but with the name ('/patent', 'literature') it is not working. The Error on web browser is following

Not Found The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

  • It seems no problem with code. Do all html files are in the right directory? – shimo Jul 05 '20 at 02:45
  • always put full error message (starting at word "Traceback") in question (not comment) as text (not screenshot). There are other useful information. – furas Jul 05 '20 at 03:57
  • do you get correct page with `/` ? Maybe you have other route with `/` in other file and you get different page - and it would measn all your route in this file doesn't work. Where is main code with `app = Flask(...)` ? How do you add `Blueprint` to this `app` ? Did you run it with `debug=True` ? Did you run it using built-in server in Flask or with other web server like `nginx`, `apache`, `gunicorn`, etc. – furas Jul 05 '20 at 04:00
  • maybe see doc [Blueprints](https://flask.palletsprojects.com/en/1.1.x/blueprints/) - there is `app.url_map` to see routes after `app.register_blueprint(bp)` – furas Jul 05 '20 at 04:03
  • Windows is case insensitive whereas linux is. Have you checked that you don't use uppercase chars in your directories ? This would lead to windows running your script correctly, but linux failing to run it since `Graph` and `graph` are different to linux. – Orsiris de Jong Jul 05 '20 at 10:23

1 Answers1

0

I have removed 3rd parameter (url_prefix='/'), and then all routes is working well for Ubuntu.

bp = Blueprint('graph', __name__)

please visit website http://18.212.192.49