WebApp

Check-in [e4d4efd593]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Testing session with simple_webapp.py
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:e4d4efd59393d50a504366df71ba7335b257953090976272b1204b861c564f31
User & Date: sebpc 2018-05-24 16:44:07
Context
2018-05-25
18:28
Created checker decorator and a decorator template, checker implemented to simple_webapp check-in: 083431b7de user: sebpc tags: trunk
2018-05-24
16:44
Testing session with simple_webapp.py check-in: e4d4efd593 user: sebpc tags: trunk
16:25
Testing session with quick_session.py check-in: 797f77c5d7 user: sebpc tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added simple_webapp.py.













































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from flask import Flask, session

app = Flask("__name__")

app.secret_key = "ddf4545gf$%56fASD"

@app.route('/login')
def do_login() -> str:
    session['logged_in'] = True
    return 'Jestes teraz zalogowany'

@app.route('/logout')
def do_logout() -> str:
    session.pop('logged_in')
    return 'Nie jestes zalogowany'

@app.route('/status')
def check_status() -> str:
    if 'logged_in' in session:
        return 'Jestes zalogowany'
    return 'Nie jestes zalogowany'
@app.route('/')
def hello() -> str:
    return 'Hello from the simple webapp'

@app.route('/page1')
def page1() -> str:
    return 'this is page 1'

@app.route('/page2')
def page2() -> str:
    return 'this is page 2'

@app.route('/page3')
def page3() -> str:
    return 'this is page 3'

app.run(debug=True)