improved project
Some checks failed
Build and Deploy Demo App / build-and-deploy (push) Failing after 18s
Some checks failed
Build and Deploy Demo App / build-and-deploy (push) Failing after 18s
This commit is contained in:
@@ -4,5 +4,6 @@ WORKDIR /app
|
|||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
COPY app.py .
|
COPY app.py .
|
||||||
|
COPY templates ./templates
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
CMD ["python", "app.py"]
|
CMD ["python", "app.py"]
|
||||||
|
|||||||
9
app.py
9
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__)
|
app = Flask(__name__)
|
||||||
|
bootstrap = Bootstrap5(app)
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def hello():
|
def index():
|
||||||
return "<h1>Hello from the Realistic Demo App!</h1><p>This is a simple Flask server for demonstration.</p>"
|
return render_template('index.html')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host='0.0.0.0', port=5000)
|
app.run(host='0.0.0.0', port=5000)
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
flask==3.0.3
|
flask==3.0.3
|
||||||
|
flask-bootstrap==0.14.0 # Latest version supporting BS5
|
||||||
|
|||||||
92
templates/index.html
Normal file
92
templates/index.html
Normal file
@@ -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() }} <!-- Optional IE8 fix if needed -->
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block styles %}
|
||||||
|
{{ super() }} <!-- Includes Bootstrap CSS -->
|
||||||
|
<style>
|
||||||
|
body { padding-top: 60px; } /* Space for fixed navbar */
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block navbar %}
|
||||||
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
|
||||||
|
<div class="container">
|
||||||
|
<a class="navbar-brand" href="/">Demo Pro Site</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
|
<ul class="navbar-nav ms-auto">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/">Home</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#features">Features</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#about">About</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<!-- Hero Section -->
|
||||||
|
<div class="jumbotron text-center bg-primary text-white py-5 mt-4 rounded">
|
||||||
|
<h1 class="display-4">Welcome to the Professional Demo Site</h1>
|
||||||
|
<p class="lead">This is a realistic, Bootstrap-powered Flask application for demonstration purposes. It features responsive design and modern UI elements.</p>
|
||||||
|
<a class="btn btn-light btn-lg" href="#features" role="button">Learn More</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Features Section -->
|
||||||
|
<section id="features" class="py-5">
|
||||||
|
<h2 class="text-center mb-4">Key Features</h2>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Responsive Design</h5>
|
||||||
|
<p class="card-text">Adapts seamlessly to mobile, tablet, and desktop devices.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Modern UI</h5>
|
||||||
|
<p class="card-text">Uses Bootstrap 5 for clean, professional styling.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Easy Deployment</h5>
|
||||||
|
<p class="card-text">Containerized with Docker for quick setup on any server.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- About Section -->
|
||||||
|
<section id="about" class="py-5 bg-light">
|
||||||
|
<h2 class="text-center mb-4">About This Demo</h2>
|
||||||
|
<p class="text-center">This site serves as a starting point for building more complex web applications. Extend it with databases, APIs, or user authentication as needed.</p>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block scripts %}
|
||||||
|
{{ super() }} <!-- Includes Bootstrap JS -->
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user