Why not just use a parameter that can potentially be empty, with a default value of None
?
@app.route('/item/<int:appitemid>/')
@app.route('/item/<int:appitemid>/<path:anythingcanbehere>')
def show_item(appitemid, anythingcanbehere=None):
More Related Contents:
- Flask url_for generating http URL instead of https
- Flask app that routes based on subdomain
- How to serve static files in Flask
- Store large data or a service connection per Flask session
- Flask view return error “View function did not return a response”
- jsonify a SQLAlchemy result set in Flask [duplicate]
- Testing code that requires a Flask app or request context
- How do I get the different parts of a Flask request’s url?
- Flask to return image stored in database
- Why use Flask’s url_for?
- Remove file after Flask serves it
- Making an asynchronous task in Flask
- Send data from a textbox into Flask?
- Start a flask application in separate thread
- Serve image stored in SQLAlchemy LargeBinary column
- Trying to run Flask app gives “Address already in use”
- Flask view shows 400 error instead of template with form
- Create dynamic arguments for url_for in Flask
- Using Flask, how do I modify the Cache-Control header for ALL output?
- Flask jsonify a list of objects
- Python flask app routing in cpanel: can only access root url
- demystify Flask app.secret_key
- Flask throwing ‘working outside of request context’ when starting sub thread
- How to run Flask app with Tornado
- Run Flask CLI command with PyCharm debugger
- Get list of all routes defined in the Flask app
- Flask App: Update progress bar while function runs
- Where do I define the domain to be used by url_for() in Flask?
- How to run Flask with Gunicorn in multithreaded mode
- Converting matplotlib png to base64 for viewing in html template