This Flask application serves as a simple blog platform where users can register, log in, create, edit, and delete posts, and update their account information including their profile pictures. It also includes an about page to provide information about the website.
To run the application locally, follow these steps:
- Clone this repository to your local machine:
git clone https://github.com/ghaefner/Blog
- Navigate to the project directory:
- Install the required dependencies:
pip install -r requirements.txt
- Run the application:
python run.py
- Open your web browser and go to
http://localhost:5000to access the application.
Users can register for a new account by providing a username, email, and password. After registration, they can log in using their email and password.
The home page displays all posts created by users. Users can view posts and click on individual posts to view their details.
Logged-in users can access their account page where they can update their username, email, and profile picture. They can also delete their profile picture if needed.
Users can create a new post by providing a title and content in the "New Post" form.
Users can update or delete their own posts if they are the author of the post.
The about page provides information about the website or project.
The file structure of the project is as follows:
flaskblog:
│
├── run.py
│
├── flaskblog/
│ ├── init.py
│ ├── models.py
│ ├── routes.py
│ ├── forms.py
│ ├── static/
│ │ ├── profile_pics/
│ │ └── main.css
│ │
│ ├── templates/
│ │ ├── about.html
│ │ ├── account.html
│ │ ├── create_post.html
│ │ ├── home.html
│ │ ├── layout.html
│ │ ├── login.html
│ │ ├── post.html
│ │ └── register.html
│ │
│ └── migrations/ (generated by Flask-Migrate for database migrations, tbd.)
│
├── migrations/ (contains database migration files, tbd.)
├── tests/ (contains unit tests, tbd.)
├── README.md
└── requirements.txt
This project requires the following dependencies:
- Flask
- flask-wtf
- email_validator
- sqlalchemy
- flask-sqlalchemy
- flask-bcrypt
- flask-login
- flask-mail
- pillow
These dependencies are listed in the requirements.txt file and can be installed using pip.