Flask icon indicating copy to clipboard operation
Flask copied to clipboard

error on my python flask project

Open israelnojr opened this issue 9 years ago • 3 comments

hello friends am having this error SyntaxError was unhandled by user code Message: invalid syntax (routes.py, line 56) my python flask project please needs urgent help python error

israelnojr avatar Feb 19 '16 00:02 israelnojr

Hi, you just need to remove the semi colon (;) Besides, Why are you importing routes? it is already taken care of when you import the flask and define app

Daralm avatar Feb 19 '16 00:02 Daralm

@Daralm thanks for responding to my question,

I remove the from routes import *; then here am having the error 404 (Not Found

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

israelnojr avatar Feb 20 '16 22:02 israelnojr

here is my code

""" This script runs the application using a development server. It contains the definition of routes and views for the application. """

from flask import Flask app = Flask(name)

Make the WSGI interface available at the top level so wfastcgi can get it.

wsgi_app = app.wsgi_app

if name == 'main': import os HOST = os.environ.get('SERVER_HOST', 'localhost') try: PORT = int(os.environ.get('SERVER_PORT', '5555')) except ValueError: PORT = 5555 app.run(HOST, PORT)

israelnojr avatar Feb 20 '16 22:02 israelnojr