Skip to content

Instantly share code, notes, and snippets.

@LairdStreak
Forked from commadelimited/flask.py
Created September 3, 2020 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LairdStreak/5332482bf660e55eaba90bc9be035b21 to your computer and use it in GitHub Desktop.
Save LairdStreak/5332482bf660e55eaba90bc9be035b21 to your computer and use it in GitHub Desktop.
Multiple Flask URL routes on a single method
@course.route('/courses/<slug>_<id>/print/')
@course.route('/courses/<slug>_<id>/')
def show_course(slug=None, id=None):
# how do I know whether /print was used, or just normal?
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment