A modern, responsive web application built with Flask and Bootstrap. This project demonstrates best practices for Python web development with a beautiful, user-friendly interface.
- Modern UI/UX: Clean, responsive design that works on all devices
- Flask Backend: Lightweight and flexible Python web framework
- Bootstrap 5: Modern CSS framework for responsive design
- Interactive Elements: JavaScript-powered features and animations
- Contact Form: Working contact form with AJAX submission
- API Endpoints: RESTful API for data access
- Mobile-First: Optimized for mobile devices
Before you begin, ensure you have the following installed:
- Python 3.7 or higher
- pip (Python package installer)
- Git (optional, for version control)
-
Clone or download this repository
git clone <repository-url> cd test_project
-
Create a virtual environment (recommended)
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Start the Flask development server
python app.py
-
Open your web browser Navigate to
http://localhost:5000orhttp://127.0.0.1:5000 -
Explore the application
- Home page with hero section and features
- About page with technology stack information
- Contact page with working contact form
- API endpoints for data access
test_project/
βββ app.py # Main Flask application
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ templates/ # HTML templates
β βββ base.html # Base template with navigation
β βββ index.html # Home page
β βββ about.html # About page
β βββ contact.html # Contact page
βββ static/ # Static files
βββ css/
β βββ style.css # Custom CSS styles
βββ js/
βββ main.js # JavaScript functionality
The application runs with the following default settings:
- Host: 0.0.0.0 (accessible from any IP)
- Port: 5000
- Debug Mode: Enabled (for development)
To modify these settings, edit the app.run() call in app.py:
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=5000)The application provides several API endpoints:
GET /- Home pageGET /about- About pageGET /contact- Contact pagePOST /contact- Submit contact formGET /api/posts- Get all posts (JSON)GET /api/posts/<id>- Get specific post (JSON)
- Create a new HTML template in the
templates/directory - Add a new route in
app.py:@app.route('/new-page') def new_page(): return render_template('new_page.html')
Edit static/css/style.css to customize the appearance. The CSS uses CSS custom properties (variables) for easy theming.
Add your JavaScript code to static/js/main.js or create new JS files and include them in your templates.
For production deployment, consider:
- Set debug=False in
app.py - Use a production WSGI server like Gunicorn:
pip install gunicorn gunicorn -w 4 -b 0.0.0.0:8000 app:app
- Use environment variables for configuration
- Set up a reverse proxy with Nginx or Apache
- Use HTTPS for security
-
Install new packages:
pip install package-name
-
Update requirements.txt:
pip freeze > requirements.txt
- app.py: Main application logic and routes
- templates/: HTML templates using Jinja2
- static/: CSS, JavaScript, and other static assets
- requirements.txt: Python package dependencies
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Contact the development team
Happy coding! πβ¨