Created
November 23, 2014 06:21
-
-
Save commadelimited/d78432b9df940b0bdae2 to your computer and use it in GitHub Desktop.
Multiple Flask URL routes on a single method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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
This works perfect for me, thanks.