SHARE
TWEET

Untitled

a guest Dec 1st, 2016 158 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from bottle import route, run, static_file, request, template, hook, response
  2. from datetime import datetime
  3. import sqlite3
  4. import re
  5.  
  6. @route('/')
  7. def root():
  8.     return "<a href='/registration'>registration</a>"
  9.  
  10. @route('/registration')
  11. def check():
  12.     response.headers["Access-Control-Allow-Origin"] = "*"
  13.     name = request.GET.get("name", "").strip()
  14.     result = re.match(r"user\d", name)
  15.     if result:
  16.         return "ok"
  17.     else:
  18.         return "not ok"
  19.  
  20.  
  21.  
  22. run(host='127.0.0.1', port=8080, debug=True)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top