b
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,6 +7,7 @@ __pycache__/
|
||||
*.so
|
||||
|
||||
.idea
|
||||
postgres_data
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
|
||||
4
app.py
4
app.py
@@ -1,11 +1,11 @@
|
||||
from flask import Flask
|
||||
from flask import Flask, render_template, request
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def hello_world(): # put application's code here
|
||||
return 'Hello World!'
|
||||
return render_template("index.html")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -12,3 +12,23 @@ services:
|
||||
environment:
|
||||
- FLASK_APP=app.py
|
||||
- FLASK_ENV=development
|
||||
- DATABASE_URL=postgresql://flaskuser:flaskpass@db:5432/flaskdb
|
||||
depends_on:
|
||||
- db
|
||||
restart: unless-stopped
|
||||
|
||||
db:
|
||||
image: postgres:15
|
||||
container_name: postgres_db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_USER=flaskuser
|
||||
- POSTGRES_PASSWORD=flaskpass
|
||||
- POSTGRES_DB=flaskdb
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
19
templates/base.html
Normal file
19
templates/base.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<html lang="de">
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
<meta charstet="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title> {% block title %} {% endblock %} </title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1> Herzlich Willkommen auf der Website der BI23b! </h1>
|
||||
<p> Zurücklehnen und genießen... </p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
5
templates/index.html
Normal file
5
templates/index.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}
|
||||
HURENSOHN
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user