#!/usr/bin/python3
from flask import Flask, request, render_template, make_response, redirect, url_for
#플래스크 시작
app = Flask(__name__) # double underscores (__name__) 현재 활성 모듈을 나타냄
@app.route('/admin')
맨 앞에 @을 붙이면 장식자(decorator)로 URL 연결에 활용된다.
장식자 사용 후 다음 행의 함수부터 장식자가 적용된다.
@app.route('/admin')
def admin():
# what is it? Does this page tell you session?
# It is weird... TODO: the developer should add a routine for checking privilege
return session_storage
if __name__ == '__main__':
import os
# create admin sessionid and save it to our storage
# and also you cannot reveal admin's sesseionid by brute forcing!!! haha
session_storage[os.urandom(32).hex()] = 'admin'
print(session_storage)
app.run(host='0.0.0.0', p
ort=8000)