Skip to content

Instantly share code, notes, and snippets.

@commadelimited
Created November 23, 2014 06:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save commadelimited/d78432b9df940b0bdae2 to your computer and use it in GitHub Desktop.
Save commadelimited/d78432b9df940b0bdae2 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
@mrroot5
Copy link

mrroot5 commented Aug 10, 2018

This works perfect for me, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment