File size: 1,887 Bytes
2f7dbb4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
server:
  port: 5555
  host: 127.0.0.1
  debug: true
  threaded: true
  processes: 4
  use_reloader: false
  static_url_path: /static
  static_folder: static
  template_folder: templates
  secret_key: "my_secret_key"

  # Database configuration
  database:
    db_name: my_db
    db_user: my_user
    db_password: my_password
    db_host: 127.0.0.1
    db_port: 5432

  # Email configuration
  email:
    server: smtp.gmail.com
    port: 587
    username: my_email@gmail.com
    password: my_email_password
    use_tls: true

  # Authentication configuration
  authentication:
    login_url: /login
    logout_url: /logout
    login_manager:
      login_view: 'login'
      login_message: 'Please log in to access this page.'
      login_message_category: 'info'
      user_loader: 'load_user'
    user_manager:
      user_loader: 'load_user'
      user_model: 'User'

  # Routing configuration
  routing:
    routes:
      - name: home
        path: /
        endpoint: index
      - name: login
        path: /login
        endpoint: login
      - name: logout
        path: /logout
        endpoint: logout
      - name: user
        path: /user
        endpoint: user
      - name: admin
        path: /admin
        endpoint: admin

  # Template configuration
  templates:
    index:
      template: index.html
      context:
        title: 'My Streamlit App'
        text: 'Welcome to my Streamlit app!'
    login:
      template: login.html
      context:
        title: 'Log in'
        text: 'Please log in to access this page.'
    logout:
      template: logout.html
      context:
        title: 'Log out'
        text: 'You have been logged out.'
    user:
      template: user.html
      context:
        title: 'User'
        text: 'This is the user page.'
    admin:
      template: admin.html
      context:
        title: 'Admin'
        text: 'This is the admin page.'