Advertisement
AtEchoOff

Untitled

Jun 29th, 2024 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. Welcome.html:
  2.  
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset='utf-8'>
  7. <meta http-equiv='X-UA-Compatible' content='IE=edge'>
  8. <title>Login</title>
  9. <meta name='viewport' content='width=device-width, initial-scale=1'>
  10. <link rel='stylesheet' type='text/css' media='screen' href='/static/style.css'>
  11. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
  12. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  13. <script src="/static/index.js"></script>
  14. </head>
  15. <body>
  16. <div id="top">
  17. <h1>Welcome!</h1>
  18. <!-- {%for key, value in links.items()%}
  19. <a href="{{value}}">{{key}}</a>
  20. {%endfor%} -->
  21. </div>
  22. <div style="text-align: center;">
  23. {% if message %}
  24. <p class="valid"> {{message}} </p>
  25. {% endif %}
  26.  
  27. <!-- Youre logged in as {{username}} -->
  28. <!-- To Log out click <a href="/logout">this</a> link -->
  29. </div>
  30. </body>
  31. </html>
  32.  
  33.  
  34. style.css:
  35.  
  36. #top {
  37. background-color: blanchedalmond;
  38. border: 2px solid black;
  39. box-shadow: 0px 5px 5px black inset;
  40. text-align: center;
  41. margin: 10px;
  42. }
  43. body {
  44. text-align: center;
  45. background-color: navajowhite !important;
  46. }
  47. * {
  48. font-family:
  49. 'Arial';
  50. }
  51. .wrapper {
  52. width: 20%;
  53. padding: 10px;
  54. border-radius: 5px;
  55. background: #f8ca85;
  56. margin: auto;
  57. }
  58. form {
  59. margin: 25px auto;
  60. }
  61. .btn {
  62. width: auto;
  63. border: none;
  64. margin-top: 5px;
  65. color: white;
  66. background-color: #3b5998;
  67. border-radius: 5px;
  68. padding: 12px;
  69. }
  70. .form-control {
  71. width: 50%;
  72. }
  73. .error {
  74. color: red;
  75. text-align: center;
  76. }
  77. .valid {
  78. color: green;
  79. }
  80.  
  81.  
  82. app.py
  83.  
  84. from flask import Flask, render_template, request, session, make_response, redirect
  85. app = Flask(__name__)
  86. app.secret_key = "super secret key"
  87.  
  88. if __name__ == '__main__':
  89. import os
  90. HOST = os.environ.get('SERVER_HOST', 'localhost')
  91. try:
  92. PORT = int(os.environ.get('SERVER_PORT', '5555'))
  93. except ValueError:
  94. PORT = 5555
  95. app.run(HOST, PORT)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement