Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------------------
- app.py
- from flask import Flask, render_template, request, session, make_response, redirect
- app = Flask(__name__)
- app.secret_key = "super secret key"
- @app.route('/')
- def index():
- return render_template("index.html")
- if __name__ == '__main__':
- import os
- HOST = os.environ.get('SERVER_HOST', 'localhost')
- try:
- PORT = int(os.environ.get('SERVER_PORT', '5555'))
- except ValueError:
- PORT = 5555
- app.run(HOST, PORT, debug=True)
- ----------------------------------------------------------------
- index.html
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset='utf-8'>
- <meta http-equiv='X-UA-Compatible' content='IE=edge'>
- <title>My Portfolio!</title>
- <meta name='viewport' content='width=device-width, initial-scale=1'>
- <link rel='stylesheet' type='text/css' media='screen' href='/static/style.css'>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/3.0.1/js.cookie.min.js"></script>
- <script src="/static/index.js"></script>
- </head>
- <body>
- <div id="top">
- <h1>Hello world!</h1>
- </div>
- <div style="text-align: center;">
- <h3>Hello! This is the index page of my website!</h3>
- </div>
- </body>
- </html>
- ------------------------------------------------------------------
- style.css
- #top {
- background-color: blanchedalmond;
- border: 2px solid black;
- box-shadow: 0px 5px 5px black inset;
- text-align: center;
- margin: 10px;
- }
- body {
- text-align: center;
- background-color: navajowhite !important;
- }
- * {
- font-family:
- 'Arial';
- }
- .wrapper {
- width: 20%;
- padding: 10px;
- border-radius: 5px;
- background: #f8ca85;
- margin: auto;
- }
- form {
- margin: 25px auto;
- }
- .btn {
- width: auto;
- border: none;
- margin-top: 5px;
- color: white;
- background-color: #3b5998;
- border-radius: 5px;
- padding: 12px;
- }
- .form-control {
- width: 50%;
- }
- .error {
- color: red;
- text-align: center;
- }
- .valid {
- color: green;
- }
- ul {
- width: 30%;
- margin: auto;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement