diff --git a/__pycache__/config.cpython-38.pyc b/__pycache__/config.cpython-38.pyc new file mode 100644 index 0000000..e9bf17e Binary files /dev/null and b/__pycache__/config.cpython-38.pyc differ diff --git a/config.py b/config.py new file mode 100644 index 0000000..3aee388 --- /dev/null +++ b/config.py @@ -0,0 +1,2 @@ +DEBUG= True + diff --git a/main.py b/main.py index 95e7c46..132bdcf 100644 --- a/main.py +++ b/main.py @@ -1,16 +1,26 @@ import os import requests from flask import Flask, render_template, request, redirect, url_for, session +from werkzeug.routing import BaseConverter app = Flask(__name__) +class PhoneConverter(BaseConverter): + regex = '1[3-9]\d{9}' + +app.url_map.converters["phone"] = PhoneConverter + @app.route("/", methods=["GET", "POST"]) def index(): - return render_template("index.html") +@app.route("/") +def phone(param): + return param + if __name__ == "__main__": + app.config.from_pyfile("config.py") app.run(host="0.0.0.0") \ No newline at end of file