This is a simple Flask blog application with CRUD functionality for posts, and simple user authentication. This application is made for the purpose of creating test automation and is not intended for production use. This is a fork of the original FlaskBlog project that has been developed for educational purposes.
- Python 3.x
- pip
-
Clone the repository:
git clone <repo-url> cd CodeBlog
-
(Optional) Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Initialize the database:
python init_db.py
-
Run the application:
flask run
The app will be available at http://127.0.0.1:5000/
- Docker
-
Build the Docker image:
docker build -t codeblog .
-
Run the Docker container:
docker run -p 5000:5000 codeblog
The app will be available at http://127.0.0.1:5000/
Create docker network:
docker network create codeblog_network
Build both containers (tests and the application)
docker build -t codeblog .
docker build -t codeblog_tests -f robot_tests/Dockerfile
Run both containers in the same network.
docker run -p 5000:5000 --network codeblog_network --name codeblog_app codeblog
...
docker run --network codeblog_network codeblog_tests
app.py
: Main Flask applicationinit_db.py
: Script to initialize the databaseschema.sql
: SQL schema for the databasetemplates/
: HTML templatesstatic/
: Static files (CSS)database.db
: SQLite database file
MIT