Flask
Flask copied to clipboard
error on my python flask project
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
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 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. )
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)