Skip to content

Instantly share code, notes, and snippets.

@Swalloow
Created March 12, 2017 12:22
Show Gist options
  • Save Swalloow/507ef580b2c1acf26c341fc44dfd0d3d to your computer and use it in GitHub Desktop.
Save Swalloow/507ef580b2c1acf26c341fc44dfd0d3d to your computer and use it in GitHub Desktop.
Bad Url
# GET /jobs/application/6337
@app.route(/jobs/application/<job_id>)
def find_job(job_id):
SELECT * FROM job where id = job_id ...
# 대응방안으로는 `Flask-Login` 등을 사용하여 간접 참조하는 방법이 있습니다.
from flask.ext.login import login_required, current_user
@app.route("/mypage/<id>")
@login_required
def mypage(id):
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment