×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Pavel Evtikhov
Added: Feb 10, 2022 5:00 PM
Modified: Mar 31, 2022 8:01 AM
Views: 399
Tags: no tags
  1. from flask import Flask, request
  2.  
  3. app = Flask(__name__)
  4.  
  5. @app.route('/')
  6. def page_index():
  7.     return 'it is work!'
  8.                
  9. @app.route("/tag/")
  10. def page_tag():
  11.     tag = request.args.get('tag')
  12.     if not tag:
  13.         return 'Ошибка! Не указаны теги!'
  14.  
  15.     return tag
  16.  
  17. @app.route("/user/<int:id>")
  18. def page_tag(id):
  19.     return id