Disclaimer. The project is intended as a learning curve of web development with Python from a QA perspective. It doesn't aim to be a hands-on application. This web application allows users to view blog posts, read about the author, and send messages through a contact form.
- Responsive design for all devices (Bootstrap)
- Dynamic blog posts loaded from an external API (Npoint) - DEPRECATED
- Content is stored and fetched from the local database
- Individual post pages with detailed content
- About page with author information
- Contact form with email notification functionality
-
Clone the repository:
git clone <repository-url> cd how_to_blog -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate -
Install the required dependencies:
pip install -r requirements.txt -
Set up environment variables by creating a
.envfile in the project root with the following variables:MY_EMAIL=your-email@example.com MY_PASSWORD=your-email-password SMTP_SERVER=your-smtp-server (e.g., smtp.gmail.com) SECRET_KEY=your-flask-secret-key
-
Run the application:
python main.py -
Open your web browser and navigate to:
http://127.0.0.1:5000/
how_to_blog/
├── main.py # Main application file
├── README.md # Project documentation
├── static/ # Static assets
│ ├── assets/ # Images and favicon
│ ├── css/ # CSS stylesheets
│ └── js/ # JavaScript files
└── templates/ # HTML templates
├── about.html # About page template
├── contact.html # Contact page template
├── footer.html # Footer template
├── header.html # Header template
├── index.html # Home page template
└── post.html # Individual post template
- Flask: Web framework
- Requests: HTTP library for API calls
- python-dotenv: Environment variable management
- smtplib: Email functionality
The blog posts are fetched from an external API endpoint. The application uses the following endpoint:
https://api.npoint.io/405401fd224c5d58a066
A simple local SQL DB (SQLite) is created to store all posts
This project is not licensed.
Contributions are welcome but not required at all😜