NextGen is a mini blog application built with Flask. It allows users to create, update, delete, and view blog posts. The application includes an admin dashboard for managing posts and user authentication for login and logout functionality.
- Create Post: Admin can create new blog posts.
- Update Post: Admin can update existing blog posts.
- Delete Post: Admin can delete blog posts.
- View Post: Users can view blog posts.
- Admin Dashboard: Controls for managing posts.
- User Authentication: Login and logout functionality for admin.
-
Clone the repository:
git clone https://github.com/yourusername/NextGen-MiniBlog.git cd NextGen-MiniBlog
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On Windows:
-
Install dependencies:
pip install -r requirements.txt
-
Set up the database:
- Make sure you have MySQL installed and running.
- Create a database named
blog
. - Update the database connection settings in
app.py
if necessary.
-
Run the application:
python app.py
The application will be accessible at
http://127.0.0.1:5000
.
- Home Page: View the latest blog posts.
- Admin Dashboard: Access the admin dashboard by logging in.
- Login: Use the login page to authenticate as an admin.
- Signup: Register a new admin user.
- Create Post: Use the admin dashboard to create new blog posts.
- Update Post: Use the admin dashboard to update existing blog posts.
- Delete Post: Use the admin dashboard to delete blog posts.
- View Full Article: Click on a blog post to view the full article.
- Logout: Use the logout functionality to end the admin session.
- Database Settings: Update the MySQL connection settings in
app.py
to match your database configuration.
app.config["MYSQL_HOST"] = "localhost"
app.config["MYSQL_USER"] = "root"
app.config["MYSQL_PASSWORD"] = ""
app.config["MYSQL_DB"] = "blog"
app.config["MYSQL_CURSORCLASS"] = "DictCursor"