Best Flask open-source libraries and packages

User comment moderation in flask

How to moderate the comments that a blog receives from random users
Updated 2 years ago

Comment Moderation in a Flask Application

One of the challenges that administrators of an application have is the control of the comments that users post. Being able to moderate users' comments is a very important feature of a website. This application shows how you can create a custom comment moderation feature in a Flask application.

Comment Moderation in Flask

Features

  • Comment Moderation
  • User Management
  • Database Management

Tools Used

  • Flask framework
  • Flask Bootstrap (CSS framework)
  • Flask-WTF (Forms)
  • Flask-SQLAlchemy (Database)
  • Flask-Login (User Authentication)
  • Flask-Migrate (Database Migration)
  • Email Validator (Email Validation)
  • Python for programming

Deployment

Testing Deployed Application

  1. Post a comment in the home page
  2. Register for an admin account if you are new
  3. Login to your admin account to see all comments
  4. View all comments in the admin dashboard
  5. You can allow or delete the posted comments.
  6. Navigate back to the home page to see all "allowed" comments.

Testing The Application Locally

  1. Clone this repo:
git clone git@github.com:GitauHarrison/user-comment-moderation-in-flask.git`
  1. Change directory to the new repo:
cd user-comment-moderation-in-flask
  1. Create and activate a virtual environment:
$ mkvirtualenv comment_moderation
  1. Install dependencies:
(comment_moderation)$ pip3 install -r requirements.txt
  1. Run the server:
(comment_moderation)$ flask run

Learn

Flask is very unopinionated. You can pretty much build whatever feature you want. If you would like to know how I was able to integrate comment moderation into this application, check out the tutorial below:

Tags user python