From d00626a62cef19aba3532c3c31b9f8991fd34c78 Mon Sep 17 00:00:00 2001 From: gitea Date: Tue, 25 Nov 2025 18:49:09 +0330 Subject: [PATCH] improved project --- Dockerfile | 1 + app.py | 9 +++-- requirements.txt | 1 + templates/index.html | 92 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 templates/index.html diff --git a/Dockerfile b/Dockerfile index 42afe5a..e090deb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,5 +4,6 @@ WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app.py . +COPY templates ./templates EXPOSE 5000 CMD ["python", "app.py"] diff --git a/app.py b/app.py index 643e1f9..092d05d 100644 --- a/app.py +++ b/app.py @@ -1,9 +1,12 @@ -from flask import Flask +from flask import Flask, render_template +from flask_bootstrap import Bootstrap5 # Use Bootstrap5 for modern BS5 + app = Flask(__name__) +bootstrap = Bootstrap5(app) @app.route('/') -def hello(): - return "

Hello from the Realistic Demo App!

This is a simple Flask server for demonstration.

" +def index(): + return render_template('index.html') if __name__ == '__main__': app.run(host='0.0.0.0', port=5000) diff --git a/requirements.txt b/requirements.txt index 0647450..6100feb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ flask==3.0.3 +flask-bootstrap==0.14.0 # Latest version supporting BS5 diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..64e5951 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,92 @@ +{% extends "bootstrap/base.html" %} +{% import "bootstrap/fixes.html" as fixes %} + +{% block title %}Professional Demo Site{% endblock %} + +{% block head %} +{{ super() }} +{{ fixes.ie8() }} +{% endblock %} + +{% block styles %} +{{ super() }} + +{% endblock %} + +{% block navbar %} + +{% endblock %} + +{% block content %} +
+ +
+

Welcome to the Professional Demo Site

+

This is a realistic, Bootstrap-powered Flask application for demonstration purposes. It features responsive design and modern UI elements.

+ Learn More +
+ + +
+

Key Features

+
+
+
+
+
Responsive Design
+

Adapts seamlessly to mobile, tablet, and desktop devices.

+
+
+
+
+
+
+
Modern UI
+

Uses Bootstrap 5 for clean, professional styling.

+
+
+
+
+
+
+
Easy Deployment
+

Containerized with Docker for quick setup on any server.

+
+
+
+
+
+ + +
+

About This Demo

+

This site serves as a starting point for building more complex web applications. Extend it with databases, APIs, or user authentication as needed.

+
+
+{% endblock %} + +{% block scripts %} +{{ super() }} +{% endblock %}